Skip to content

form-submit

Reports a <form> that has no submit button inside it and none that names it with form= (WCAG H32).

Without a submit button a form can only be sent by pressing Enter in a field, which not every user knows, and which does nothing in a form with several fields in some browsers.

To fix, add a <button type="submit"> (or <input type="submit">) to the form.

Reported
...
<a href="x">text</a>
<a href="x" aria-label="n"><i></i></a>
...
<form><input name="q"></form>
<form><button>go</button></form>
<form id="f"></form><button form="f">go</button>
<table><tr><th>a</th><th>b</th></tr><tr><td>1</td><td>2</td></tr></table>
...
angular:
lint:
rules:
form-submit: warn # off (default), warn, error
html:
lint:
rules:
form-submit: warn # off (default), warn, error
svelte:
lint:
rules:
form-submit: warn # off (default), warn, error
vue:
lint:
rules:
form-submit: warn # off (default), warn, error

Enabled by the presets: html/html-validate-recommended.

Suppress one line with sudsy-disable-next-line form-submit in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate wcag/h32 partial a submit button inside the form or one that names its id with form=