title: Field only accrpting numbers input using Javascript
body: <p>I'm trying to prevent the user from entering text input in a certain field.Now i'm using extjs panels, and i'm giving the function the record of the panel. The variable phone is being extracted, but i'm not being able to check it if it's formed completely of numbers or not. Any help please?</p>
  
  <pre><code>function saveHiring(record){
      var phone = record.getField("PHONE_NUMBER").getRealValue();
         var charCode = (phone.which) ? phone.which : phone.keyCode;
  
         if (charCode != 46 &amp;&amp; charCode &gt; 31 
           &amp;&amp; (charCode &lt; 48 || charCode &gt; 57)){
  
             alert('no');
         }
         else{
  
      alert('yes');
  }
  }
  </code></pre>