Answers for "jquery disable enter key on input field"

1

jquery avoid enter submit

$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
Posted by: Guest on June-12-2020
0

jquery disable enter key submit

$(document).on('keyup keypress', 'input', function(e) {
  if(e.which == 13) {
    e.preventDefault();
    return false;
  }
});
Posted by: Guest on April-30-2020
0

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;
  }
});
Posted by: Guest on September-14-2021

Code answers related to "jquery disable enter key on input field"

Code answers related to "Javascript"

Browse Popular Code Answers by Language