title: Restriction in typing textbox in html using javascript
body: <p>i would like to seek some help....my problem is my script restricts everything but numbers...i want to do is...i can type double numbers...like 1.232....i dont want to restrict the point<code>(.)</code>...can anyone help me do that?</p>
  
  <p>current code:</p>
  
  <pre><code>&lt;input autocomplete="off" class="search_form_input" name="optA1" id="optA1" onkeypress="return isnumeric(event)" type="text" onchange="optTotal1()" /&gt;
  </code></pre>
  
  <p>script code:</p>
  
  <pre><code>&lt;script type="application/javascript"&gt;
  
    function isnumeric(evt)
        {
           var CharacterCode = (evt.which) ? evt.which : event.keyCode
  
           if (CharacterCode &gt; 31 &amp;&amp; (CharacterCode &lt; 48 || CharacterCode &gt; 57))
              return false;
  
           return true;
        }
  
  &lt;/script&gt;
  </code></pre>