This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Enter Key Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Enter Key Code" Watch "Enter Key Code" New topic
Author

Enter Key Code

Smitha Prasad
Ranch Hand

Joined: Apr 02, 2002
Posts: 41
I want to capture the event on enter key clicked on IE MAC through Javascript. I have called window.event.keycode on keydown. but this returns 0 for all the keys. How do i capture the enter key clicked?
Rajeshwari Natarajan
Ranch Hand

Joined: Mar 05, 2003
Posts: 67
keyCode 13 is for 'Enter' key.
try this one...

in JSP


regards<br />Rajeshwari. N
Smitha Prasad
Ranch Hand

Joined: Apr 02, 2002
Posts: 41
I know it is supposed to be 13 for enter key, but in mac for all the keys it is returning 0!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Enter Key Code
 
Similar Threads
enter button doesn't work on select boxes
reset caret position to begining of Jtextpane
Capturing "Enter Key" Value in Javascript
Capturing "Enter Key" or "Blank" in Switch Statement
Enter key and JTable