People dont want to submit forms when typing enter keys. So I am sharing a simple jquery code to disable enter key using JQuery 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 using jQuery
$("#formname").keypress(function(e) {
if (e.which == 13) {
return false;
}
});
You may also like – how to protect your website content using jQuery
Popular Posts from jQuery
- Quick tips to learn this keyword in JavaScript
- 20+ Useful jQuery Code Snippets for Web Developers in 2020
- jQuery Remove Elements with Animation
- How to capture webpage screenshot using javascript?
- how to show loading image in ajax request using jquery?
- New Gmail Account Login & Registration Form with Material Design and jQuery
- Export HTML Table Data to Excel, CSV, PNG, PDF, TXT, Doc, JSON & XML using jQuery
- Login & SignUp form using Material Design and jQuery
- Simple jQuery Preloader for Websites
- Simple Customer Support Chat System using jQuery & WhatsApp API
Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!
Thanks!