Return to Snippet

Revision: 23875
at February 16, 2010 06:16 by ginoplusio

Initial Code
<script type="text/javascript">
	function submitonenter(formid,evt,thisObj) {
		evt = (evt) ? evt : ((window.event) ? window.event : "")
		if (evt) {
			// process event here
			if ( evt.keyCode==13 || evt.which==13 ) {

Initial URL

Initial Description
Suppose you have a login form and you want to send the form when user press enter on his keyboard and not only by clicking on the submit button.
This can be achieved capturing a specific event when the user is typing. We have to capture the keypress event and listen to trigger an action when the enter key is pressed. Example and code in the link above.

Initial Title
How to send a form by pressing ENTER key

Initial Tags
form, event

Initial Language