Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

OnKeyPress event doesn't work in netscape?

Thread view: 
jrice@berkshire-aap.com - 06 Jan 2006 14:47 GMT
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 &amp;&amp; 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(&quot;MSIE&quot;)!=-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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.