disable enter key in jQuery
Fed up of accidentally submitting forms with the enter key, of course you probably need to be able to do newlines in text areas.
$("body").keypress(function(e) {
if (e.which == 13 && !$(e.target).is("textarea")) {
return false;
}
});
Or if you want to be more specific.
$('form input[type="submit"]').keypress(function(e) {
if (e.which == 13) {
return false;
}
});