Enter Key Focus | JavaScriptSource

Enter Key Focus

Ritesh Sutaria Dec 3, 2003
Form users can move to next text field by pressing the enter key, same as if you were to press the TAB key.

This form will not post!

The JavaScript Source: Forms: Enter Key Focus

Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!


Did you use this script?  Do you like this site?  Please link to us!

Leave a Response


It works just fine for me in Firefox 3.0. You might want to look again at the way that you have used it.

Lee Jan 16, 2009

This code does not work either in Firefox 3 or IE7, since event.keyCode seems to be a read only property;

Alberto Pastore Nov 27, 2008