Sunday, April 28, 2013

Disable Enter button in Jquery

In this post i will show how to disable Enter Keyboard Button using Jquery.

Below is the Jquery code. "Enter" keyboard button code is 13, Hence under if condition in the jquery code i have written if the keycode equals 13 it will return false and Enter Event would not get triggered.


 <script type="text/javascript">
        $("#form1").keypress(function (e) {
            if (e.keyCode == 13) {
                return false;
            }
        });
 </script>






1


2
3






No comments:

Post a Comment