Tag Archives: html

Submit an HTML form using the enter key, without JavaScript

I was delving into some simple PHP coding for the first time in a while, and was having trouble getting a form to submit when I pressed enter. Googling was ineffective, and only seemed to come up with javascript approaches, which I wanted to avoid. However, this StackOverflow question suggested the answer: add a

hidefocus="true"

attribute to the submit button. I did this, and everything worked beautifully.