You can respect your mouse-independent users by automatically
submitting your form if the [ENTER] key is pressed.
In order for this to work, your <FORM> tag must include
the submission information. |
| <form action='submitCGI.cgi' method='POST'> |
Add this code to your <BODY> tag: |
| <body onkeypress = "enterSubmit()"> |
Add this to the <SCRIPT> tag in your <HEAD> statements: |
function enterSubmit() {
if (window.event.keyCode == 13)
{
document.forms(0).submit();
return false;
}
}
|
If your form requires client-side validation in a JavaScript function,
you can replace the "document.forms(0).submit();" with the call to your function. |