Skip to main content
DrupalMaze
Free quote

Accessible error messages in Drupal forms: what WCAG 3.3.1 requires

What 3.3.1 actually asks for

Success Criterion 3.3.1 (Error Identification) requires that when a submission error is detected, the item in error is identified and described to the user in text. Three requirements hide in that sentence: the error exists as text (not just a red border), it is associated with the specific field, and assistive technology can perceive the association.

What Drupal core already does

Core's Form API is better than most frameworks. Failed elements get aria-invalid="true", a message prints in a status region announced via role="alert", and message text links to the field anchor. On a vanilla form, you pass 3.3.1 without trying.

Where real sites fall short

Three failure patterns show up constantly. First: custom themes strip or relocate the status-messages block, so errors render nowhere. Second: multi-step and AJAX forms replace the form but never move focus — the user submits and hears silence. Third: visual-only errors — a red outline with no text, usually because a designer hid the messages region.

The association that matters

Linking the error text to the input is the part that changes lives. Screen reader users navigate by field; an error list at the top that does not name fields fails them. Drupal's default messages include the field label — keep that. If you build inline errors per field, use aria-describedby pointing at the error element's ID, not just visual proximity.

AJAX forms need focus management

When #ajax rebuilds a form region, announce the result: move focus to the messages container with tabindex="-1", or use Drupal.announce() for simple confirmations. Without it, error messages technically exist — but no assistive technology user ever hears them, which fails the spirit and usually the audit.

A five-minute self-check

Empty-submit every public form with NVDA or VoiceOver running. You should hear an alert, the field names, and reach the first errored field in one Tab. If any of the three fails, you have a 3.3.1 defect with a known fix — most are template or focus problems, not architecture.

Forms are where accessibility debt hides. Our Drupal services include form-layer remediation.

Bring us your beautifully complicated problem.

↗