How to disable enter key on a form in jQuery

To disable enter key on a form in jQuery you can use the following snippet.

Sample jQuery

$("#form").keypress(function(event) {
  if (event.which == 13) {
    return false;
  }
});

Please Share us:
Please rate this snippet

2 thoughts on “How to disable enter key on a form in jQuery

Leave a Reply