Share icon

If you want to prevent the form submit using jquery, then this page helps you to doing this.

jQuery(document).ready(function() {
                jQuery(window).keydown(function(event) {
                    if (event.keyCode == 13) {
                        event.preventDefault();
                        return false;
                    }
                });
            });

 

See the Pen jquery prevent enter by key2goal (@key2goal) on CodePen.

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.