How to Disable Enter Key using JQuery

In this blog I will show to disable enter key using JQuery. Follow the steps mentioned below:

Step 1: Download following jQuery and add on your page

<script type="text/javascript" src="js/36d/jquery-1.4.2.min.js"></script>

Step 2: Add below code on your page between head tags

<script type="text/javascript">

$(document).ready(function () {

    $("form").bind("keypress", function (e) {

          if (e.keyCode == 13) {

               return false;

          }

      });

 });       

</script>

 
Step 3: Run your page and check.
 

Ebook Download
View all
Learn
View all