0

I am troubling with a small issue, which is a form submission by hitting the "Enter" key. Actually, it is working fine when I have one text field. But my issue how can I submit the form when I have all types of fields (Input text, Text area, drop down, radio button, check box, etc). I need to submit form when I hit the "Enter" key at a particular field.

2 Answers2

0

Maybe this can help, you basically make the enter key submit a form not depending on the current focused field: Submit form with Enter key without submit button?

Community
  • 1
  • 1
0

HTML forms submit automatically when you hit the enter key if

  • The element with focus is a single-ling text field

AND

  • The field is the only field in the form; OR
  • The form has at least one button or an input with type=submit

In your case, you may include a button <button type="submit">Submit</button>, and you can hide it using CSS if you don't want it showing.

Kizer
  • 1,268
  • 1
  • 12
  • 24