Conformance
Form meets WCAG 2.2 level AA when used as described on these pages.
What Form gives you
FormLabelis a<label>pointed at the control.FormControlsets the control’sid,aria-invalidwhen there is an error, andaria-describedbyto the help text and the error.- Help text in
color.text.subtle, errors incolor.text.danger, labels incolor.text.
What your team does
- Write messages that say how to fix the problem.
- Add
novalidateto the<form>so the browser’s own bubbles don’t replace your messages. - After a failed submit, move focus to the first field with an error.
- Keep the submit button enabled.
- Don’t time out a form people are filling in.
WCAG criteria
| Criterion | Level | How |
|---|---|---|
| 1.3.1 Info and Relationships | A | Label, aria-describedby set by FormControl |
| 3.3.1 Error Identification | A | aria-invalid and a message in words |
| 3.3.2 Labels or Instructions | A | Label and help text |
| 3.3.3 Error Suggestion | AA | Messages say how to fix it |
| 3.3.4 Error Prevention | AA | Checked before sending; your team adds a review step for legal or money changes |