Allow only numbers in JavaScript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/469357/html-text-input-allow-only-numeric-input">HTML Text Input allow only Numeric input</a>  </p>
</blockquote>



<p>I used this script</p>

<pre><code>function isNumberKey(evt)
  {
    var e = event || evt; // for trans-browser compatibility
    var charCode = e.which || e.keyCode;                        
    if (charCode &gt; 31 &amp;&amp; (charCode &lt; 47 || charCode &gt; 57))
    return false;
    if (e.shiftKey) return false;
    return true;
 }
</code></pre>

<p>But this script not working in firefox alone.
Any alternatives to restrict user for shift key in javascript?</p>
