Code Snips
Web Portfolio
Resume
News Finder
Katrina News
Usenet Info
EnronOffline
 
Alex Pages
Web Cam
Old Photos
Yahoo Pool
24 Predictions
Bellaire West
Our Cats
NASA & Mars
SSX High Score
Dunder-Mifflin
Office Space
 
Contact Page
 
Back ...   

Submit on [ENTER] Keypress



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.



Find the latest information on the Enron Trial at EnronOffline, the once-a-day wrap up.