How to Disable Enter Key Using JQuery In ASP.NET

In this blog, I will show how to disable the Enter key on a Web page using JQuery. Follow the steps mentioned below:
 
Step 1: Download the attached jQuery, add on your project and include this in your Web page. 
  1. <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. 
  1. <script type="text/javascript">  
  2. $(document).ready(function () {  
  3. $("form").bind("keypress", function (e) {  
  4. if (e.keyCode == 13) {  
  5. return false;  
  6. }  
  7. });  
  8. });  
  9. </script>  
Step 3: Run your page and check. Try to use ENTER key.