Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Steps to duplicate:
- Create a new Drupal install
- Create a variety of fields for any content type, such as a taxonomy autocomplete field
- Go to the add form for that content type, type something in a field (such as the title or an autocomplete field), and hit the enter key
Expected operation: nothing should happen; the form is not complete, and the user is not focused on the save button
Actual operation: the entire form is submitted. This could cause incomplete content to be submitted, or the users may get an error when required fields are not filled in. Some users habitually hit the enter key after entering any content in a field, and they run into this issue frequently.
Currently, I am using a custom module to disable the enter key via javascript.
Comments
Comment #1
swentel CreditAttribution: swentel commentedsee #212423: Standardize form submission behavior when "enter" key is pressed