The button should be submitting on Enter
, if it's not, there's something in the HTML that you have not provided. You have tagged the question with JQuery but have not provided any code, so I can only assume that you are submitting the form through only PHP.
Take a look at the button documentation. There are two paragraphs there that are relevant to your situation.
form HTML5
The form element that the button is associated with (its form owner). The value of the attribute must be the id attribute of a
element in the same document. If this attribute is not
specified, the element must be a descendant of a form
element. This attribute enables you to place elements
anywhere within a document, not just as descendants of their
elements.
This means that for the button to submit the form, it must be inside the form
tags. If it is not, you need to specify the form id like this.
<button form="form_id">
The second relevant piece of information.
type
The type of the button. Possible values are:
submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is
dynamically changed to an empty or invalid value.
reset: The button resets all the controls to their initial values.
button: The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when
the events occur.
Since type
defaults to submit
, it means that the form will submit with the Enter
key.