WCAG H36: Require alt text on images used as submit buttons

Rule ID:
wcag/h36
Category:
Accessibility
Standards:
  • WCAG 2.2 (A)
  • WCAG 2.1 (A)
  • WCAG 2.0 (A)

WCAG H36 requires all images used as submit buttons to have a non-empty textual description using the alt attribute. The text must indicate the buttons function but not describe the image.

See wcag/h37 for a similar rule for <img>.

Rule details

Examples of incorrect code for this rule:

<!-- missing alt attribute -->
<input type="image" src="submit-button.png">

<!-- empty alt attribute -->
<input type="image" src="submit-button.png" alt="">
error: image used as submit button must have non-empty alt text (wcag/h36) at inline:2:2:
  1 | <!-- missing alt attribute -->
> 2 | <input type="image" src="submit-button.png">
    |  ^^^^^
  3 |
  4 | <!-- empty alt attribute -->
  5 | <input type="image" src="submit-button.png" alt="">


error: image used as submit button must have non-empty alt text (wcag/h36) at inline:5:45:
  3 |
  4 | <!-- empty alt attribute -->
> 5 | <input type="image" src="submit-button.png" alt="">
    |                                             ^^^


2 errors found.

Examples of correct code for this rule:

<input type="image" src="submit-button.png" alt="Submit Button">