Skip to content

Chapter 6 of 8

Forms, Buttons, and Controls

Form controls need to be properly labeled so users understand their purpose. Associating a label with a form control is best done using `

aria-required="true" indicates that a field must be filled in before submission, and aria-invalid="true" marks a field as failing validation; when set, the screen reader announces the field's name together with "invalid entry" along with the error message. The standard error-handling pattern is to set aria-invalid="true" on bad fields on submit (or after the user leaves the field), associate each with an error message via aria-describedby, add an alert live region summarizing errors at the top of the form, and keep focus on the first error or the summary.

Choosing between a button and a link follows a clear rule: use a link (``) when activation navigates to a new URL or fragment, and use a button for actions that do not navigate, such as submitting a form, opening a dialog, or toggling state. A toggle button such as Bold uses a `

All chapters
  1. 1Foundations of Web Accessibility
  2. 2ARIA Fundamentals
  3. 3Keyboard Interaction and Focus
  4. 4Live Regions and Modal Dialogs
  5. 5Common Widget Patterns
  6. 6Forms, Buttons, and Controls
  7. 7Content Semantics and Structure
  8. 8Advanced Patterns and Practices

Drill it

Reading is not remembering. These come from the Accessibility Aria Patterns deck:

Q

What does the acronym "a11y" stand for in web development?

"a11y" is a numeronym for "accessibility" — 'a' + 11 letters + 'y'.

Q

What is the difference between web accessibility (a11y) and usability?

Accessibility means people with disabilities can perceive, understand, navigate, and interact with the web. Usability is the broader quality of a design being e...

Q

Which four disability categories does WCAG primarily address?

Visual, auditory, physical/motor, and cognitive/neurological disabilities.

Q

Name the three conformance levels defined by WCAG 2.1.

A (lowest), AA (mid), and AAA (highest).