-11

When a <select> field is focussed, pressing the Enter key does not submit the form. Is it possible to make it submit the form, without using JavaScript?

A solution working in quirks mode is fine, too.

John
  • 605
  • 9
  • 28
  • 3
    [This question is being discussed on Meta.](https://meta.stackoverflow.com/questions/360402/what-is-unclear-about-my-question-is-stackoverflow-se-going-to-do-something-a) – Ethan Field Dec 08 '17 at 16:09
  • 1
    @John You may be interested in reading about accessibility, aria, screen readers and the likes. There is nothing intuitive about a return submitting a form when focusing on a select field (the return is generally used to select one of the options). – Félix Adriyel Gagnon-Grenier Dec 08 '17 at 20:19

1 Answers1

7

It is not possible to alter this behaviour without using JavaScript. According to the discussion at this question, capturing the keyup event is the best option for browser compatibility.

You may want to reconsider altering this behaviour, as discussed at this question you may surprise your users by doing so.

user247702
  • 23,641
  • 15
  • 110
  • 157