WCAG 2.1 H32: Providing submit buttons (wcag/h32)

WCAG 2.1 technique H32 requires each <form> element to include at least one submit button in order to allow users to interact with the form in apredictable way. For instance pressing enter in an input field to submit.

This rule checks for the presence of:

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>
error: <form> element must have a submit button (wcag/h32) at inline:1:2:
> 1 | <form>
    |  ^^^^
  2 |     <label>
  3 |         Text field: <input type="text">
  4 |     </label>


1 error found.

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>