Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • does not work when you specifically have method="post" on your form. For instance I want the form to be submitted by buttons, but not when pressing enter while focused in the input. Commented Nov 14, 2019 at 22:16
  • for that condition you can use above answers because this answer is based on prevent form submission by enter and click both. above example have method="post" in form and its works, check again. Commented Nov 15, 2019 at 4:41
  • This doesn't work for me Commented Nov 7, 2023 at 21:59