On this page

Form

What Form gives you and what your team does.

Conformance

Form meets WCAG 2.2 level AA when used as described on these pages.

What Form gives you

  • FormLabel is a <label> pointed at the control.
  • FormControl sets the control’s id, aria-invalid when there is an error, and aria-describedby to the help text and the error.
  • Help text in color.text.subtle, errors in color.text.danger, labels in color.text.

What your team does

  • Write messages that say how to fix the problem.
  • Add novalidate to 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