Created
October 27, 2015 12:45
-
-
Save jlcrow/b0c2dce051ffd857084b to your computer and use it in GitHub Desktop.
Default Submit 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() { | |
$("form input").keypress(function (e) { | |
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { | |
$('button[type=submit] .default').click(); | |
return false; | |
} else { | |
return true; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment