Created
July 25, 2013 08:24
-
-
Save willhalling/6077831 to your computer and use it in GitHub Desktop.
Disable enter key on form
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
$('#formID').keypress(function(event){ | |
// prevent enter key action | |
if (event.keyCode == 10 || event.keyCode == 13) { | |
event.preventDefault(); | |
// still want to try and submit form when enter key pressed | |
this.submit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment