HTML Form Not Submitting on Enter Key (tested)

Whether pressing Enter submits a form is not a guess or a framework quirk — it follows a specific, testable rule from the HTML spec's implicit submission algorithm. We measured all four combinations in headless Chromium: one field vs. multiple fields, with and without a submit button.

1. Reproduced: one text input, no submit button — Enter DOES submit

<form action="/submitted-e" method="get">
  <input name="x" value="1">
</form>

We focused the input and pressed Enter. The page navigated to /submitted-e?x=1 — it submitted, even with zero submit buttons anywhere in the form. This surprises a lot of people, including us going in: the common claim is "no submit button means no implicit submission," and that is only true once a form has more than one field. With exactly one single-line text field, the browser treats Enter as an unambiguous "the user is done, submit this" signal.

2. Reproduced: two or more text inputs, no submit button — Enter does NOT submit

<form action="/submitted-i" method="get">
  <input name="x" value="1">
  <input name="y" value="2">
</form>

Same test, one extra field, Enter pressed in the first input: the page did not navigate at all. With more than one field that can trigger implicit submission and no explicit submit button, the browser has no way to know you're "done" rather than just moving between fields, so it does nothing. This is the case most people actually hit — a login form, a signup form, anything with more than one text input — and it's why "Enter doesn't submit my form" reports are almost always multi-field forms that are missing a real submit button.

3. Reproduced: two text inputs PLUS a submit button — Enter submits from either field

<form action="/submitted-h" method="get">
  <input name="x" value="1">
  <input name="y" value="2">
  <button type="submit">Go</button>
</form>

We pressed Enter in the first of the two fields. The page navigated to /submitted-h?x=1&y=2, confirmed. Once a form has an actual submit button (its "default button"), pressing Enter in any single-line text field fires a click on that button and submits — the field-count ambiguity from case 2 disappears entirely once there's a real submit control to target.

4. Reproduced: a <textarea> never submits on Enter

<form action="/submitted-g" method="get">
  <textarea name="x"></textarea>
</form>

We typed "line1", pressed Enter, then typed "line2". The field's value became "line1\nline2" — a literal newline was inserted — and the page never navigated. This holds regardless of how many other fields the form has: <textarea> is explicitly excluded from implicit submission because Enter is its normal way of entering a newline, not a submit signal.

5. Checklist

If clicking your submit button doesn't work either, that's usually a different bug — a type="button" attribute added by habit, or the button sitting outside the <form> element. See HTML Form Not Submitting for both cases, measured.

Frequently asked questions

Does a form need a submit button for Enter to submit it?

Only sometimes — we measured both outcomes. A form with exactly one single-line text input submitted on Enter with zero submit buttons present. A form with two or more text inputs and no submit button did not submit on Enter at all; adding a real submit button fixed it and made Enter work from any of the fields.

Why does Enter submit my simple search box but not my login form?

Because of the field count, confirmed by our test: a single text input (like a search box) implicitly submits on Enter even with no submit button. A login form normally has two or more fields (username and password), and we measured that case as NOT submitting on Enter unless the form has an actual submit button — which most login forms do have, which is why they usually work.

Why doesn't Enter submit my form from a textarea?

By design — we confirmed Enter inside a <textarea> inserts a literal newline (value became "line1\nline2" in our test) and never triggers submission, regardless of how many other fields exist or whether a submit button is present. If you need Enter-to-submit behavior on a textarea, you have to implement it yourself with a keydown handler and form.requestSubmit().

If I have multiple submit buttons, which one does Enter trigger?

Per the HTML spec, the form's 'default button' — the first non-disabled submit button in DOM order inside that form. We didn't need multiple buttons to confirm single-field and multi-field cases, but this follows directly from the same implicit-submission algorithm: Enter always targets that one default button, not the one most recently clicked or focused.

Does pressing Enter in any field of a multi-field form submit it, or only the last one?

Any of them, confirmed by our test: with a submit button present, we pressed Enter in the first of two text inputs and the form submitted with both fields' values included. The implicit submission rule cares about which field has focus only to decide whether to fire at all when there's no button — once a submit button exists, any single-line text field can trigger it.

Written with AI assistance. Measured on 2026-10-03 with headless Chromium 153.0.8010.12 (Playwright) on a real Linux box. Each case is a real HTML form; Enter was sent with a genuine page.keyboard.press('Enter') keypress, and submission was confirmed by checking whether the page actually navigated to the form's action URL. PlainHeaders is our extension; HTML is free.