Function to prevent enter key from submitting form

// Prevent Enter key from submitting form without returning a button click
$('form[name="Save"] > input:text').bind("keypress", function(e) {
 console.log('i');
 var code = e.which;
 if (code == 13) {
  e.preventDefault();
  return false;
 }
})

Leave a Reply