Created
June 6, 2014 13:05
-
-
Save voku/d883697b606b24dbb5ce to your computer and use it in GitHub Desktop.
submit form on enter: This function will submit a form on enter when called from onkeypress. - From http://snippetlib.com/jquery/submit_form_on_enter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function submitenter(myfield,e) { | |
var keycode; | |
if (window.event) { | |
keycode = window.event.keyCode; | |
} | |
else if (e) { | |
keycode = e.which; | |
} | |
else { | |
return true; | |
} | |
if (keycode == 13) { | |
myfield.form.submit(); | |
return false; | |
} else { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment