Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Web
Expertise: Intermediate
Jun 29, 2000



Application Security Testing: An Integral Part of DevOps

Submitting a Form with the Enter Key

Using the IE browser application, you can press the <Enter> key while filling a form to submit the form. Indeed, this is a desirable feature for any Windows application. In order to make this work for all browser applications, you just need to add a few lines of code.

The method explained here traps the keyboard events to implement this. This works on all browsers —it was tested on Internet Explorer, Netscape Navigator, Mozilla and Opera.

<script language="JavaScript">
function processEnterKey(evnt) {
    if (evnt.which == 13)

if (navigator.appName != "Microsoft Internet Explorer")
onkeydown = processEnterKey;
'myForm' identifies the form to be submitted. If the document has several forms, you may need additional logic to determine which form to submit.

Ajith Prasad
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date