This code works perfectly in IE, but does not work in Netscape 7....It
is designed to force the user to only enter numbers into a textbox. I
also want to allow them to tab over the box as well as handle an enter
key press while they are in the textbox. Here is the code.....
OnKeyPress="javascript:if(navigator.userAgent.indexOf("MSIE")!=-1)
{var keyCode = event.keyCode;}else {var keyCode = event.which;}if
(keyCode > 47 && keyCode < 58 || keyCode==8 ||
keyCode==9){return true;} else{return false};" /></td>
</tr>
anyone give me any insight into why this will not work in Netscape? if
you can please e-mail me directly.....
Thanks in advance
abigale_carson@yahoo.com - 06 Jan 2006 14:58 GMT
Hiya,
check out this thread:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/2049528a9e
2076e3/9f6c7835204bedf7?lnk=st&q=OnKeyPress+netscape+internet-explorer&rnum=1&hl
=en#9f6c7835204bedf7
or, if you prefer, or the long link breaks, here's this:
http://linkfrog.net/dadp
By the way, this is a Java group. You should probably have posted this
question in comp.lang.javascript.
Abigale
Roedy Green - 06 Jan 2006 16:24 GMT
>OnKeyPress="javascript:if(navigator.userAgent.indexOf("MSIE")!=-1)
>{var keyCode = event.keyCode;}else {var keyCode = event.which;}if
[quoted text clipped - 4 lines]
>anyone give me any insight into why this will not work in Netscape? if
>you can please e-mail me directly.....
see http://mindprod.com/jglossl/javascript.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.