form-submit
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: offhtml/html-validate-recommended
What it does
Section titled “What it does”Reports a <form> that has no submit button inside it and none that names it with form= (WCAG H32).
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...<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>...Configuration
Section titled “Configuration”angular: lint: rules: form-submit: warn # off (default), warn, errorhtml: lint: rules: form-submit: warn # off (default), warn, errorsvelte: lint: rules: form-submit: warn # off (default), warn, errorvue: lint: rules: form-submit: warn # off (default), warn, errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”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= |