Why the javascript function shown below in the code section is not working in Firefox and Chrome? but works fine in IE
<p>This code is responsible for preventing users from entering non-numeric characters such any any ascii except number [0-9]. Works fine in in IE, but not in Firefox and Chrome. Any help and suggestions are highly appreciated.</p>

<p>Thank you</p>

<pre><code>'oKeyPress': function (e) {
    e = e || window.event;
    var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
    return !(charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57));
}
</code></pre>
