Enter to submit a form (or trigger a button)

If user press enter in a form which has  a button with type “submit”, the form will be submitted automatically.

Prevent submitting form by pressing enter:

Add keypress event listener