How to prevent Users from submitting HTML form by hitting enter?

How can I disable the "Enter" key in the keyboard to prevent the HTML form submission?


  • I'll rephrase your question: how do I REALLY piss off my users?

    The answer is: don't.

  • Disabling the enter key press will affect the user experience which is not a good practice. You can use this jQuery Validation Plugin to have a workaround.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion