Disable Enter Key - Jquery

Disable Enter Key – Jquery

People dont want to submit forms when typing enter keys. So I am sharing a simple jquery code to disable enter key while typing in forms.  Those who want to disable enter key in their form to prevent form submission, they can use this code

Jquery Code to disable enter key

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

Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!

Thanks!

If you enjoyed this article, Get email updates (It’s Free)
http://w3lessons.info/wp-content/uploads/2012/11/disable-enter-key-jquery1.jpghttp://w3lessons.info/wp-content/uploads/2012/11/disable-enter-key-jquery1-150x150.jpgKarthikeyan KjqueryJquery,tips & tricks
People dont want to submit forms when typing enter keys. So I am sharing a simple jquery code to disable enter key while typing in forms.  Those who want to disable enter key in their form to prevent form submission, they can use this code Jquery Code to disable enter...