WCAG H32: Providing submit buttons
- Rule ID:
- wcag/h32
- Category:
- Accessibility
- Standards:
- WCAG 2.2 (A)
- WCAG 2.1 (A)
- WCAG 2.0 (A)
WCAG H32 requires each <form>
element to include at least one submit button in order to allow users to interact with the form in a predictable way.
For instance pressing enter in an input field to submit.
This rule checks for the presence of:
<button type="submit">
<input type="submit">
<input type="image">
Submit buttons can either be nested or associated using the form
attribute.
Rule details
Examples of incorrect code for this rule:
<form>
<label>
Text field: <input type="text">
</label>
</form>
Examples of correct code for this rule:
<form>
<label>
Text field: <input type="text">
</label>
<button type="submit">Submit</button>
</form>
Submit buttons may also use the form
attribute to associate with a form:
<form id="my-form">
...
</form>
<button form="my-form" type="submit">Submit</button>