ARIA input fields have accessible names

Form input fields have labels that screen readers can announce.

On this page

Impact

ScanGov impact ratings

About

When an input field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.

Risks

Screen readers announce form fields without names, leaving users confused.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: custom textbox with no accessible name -->
<div role="textbox" contenteditable="true"></div>

Passing pattern:

<!-- Pass: aria-label provides accessible name -->
<div role="textbox" contenteditable="true" aria-label="Search query"></div>

Error

ScanGov messaging when a site fails a standard:

Failed: ARIA input fields have accessible names

Guidance

Indicators

On this page