Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prevent enter key submitting a form jquery

$('#formid').on('keyup keypress', function(e) {
  var keyCode = e.keyCode || e.which;
  if (keyCode === 13) { 
    e.preventDefault();
    return false;
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #enter #key #submitting #form #jquery
ADD COMMENT
Topic
Name
1+5 =