9 Replies Latest reply on Jan 24, 2011 8:52 AM by Anwarul Kabir

    clear dashes onBlur

    Anwarul Kabir Newbie

      I am kind of new and trying to use javascript to do this but may be there is a better way of doing this.

       

      I am trying to clear out the dashes from a text box on blur and return the text without dashes.

       

      here is my code

       

       

       

      < h:inputText onblur = "return javaScriptFunction(form);"

       

      value = "#{searchBean.ssn}"  class="ssn">

       

      my script

       

      function
      
       javaScriptFunction(aform)
      {
      aform.ssn.value = aform.ssn.value.replace(/-/g, 
      ''); 
      
      
      }
      

       

       

      its not working. please help