Drupal renders validation error text but does not always programmatically associate it with the control that failed. The proposal gives the rendered error a stable ID and points the control at it with aria-describedby, preserving help text. The same form is shown four ways.
-
No association
Current behaviour: the error is visible, but the control does not describe it. Help text, when present, is the only description.
-
aria-describedby
The proposed direction: the control describes the error and the help text; the group fieldset describes its group error.
-
aria-errormessage
The alternative, with its support gaps and the composite-role exception. Included for comparison, not proposed.
-
Group error
Radio and checkbox groups: one error on the fieldset, no repeated association on every option.
The association in HTML
No association: the error has an ID, but the control does not reference it.
<input type="text" id="edit-name" aria-invalid="true">
<p class="error-message" id="edit-name--error-message">Name field is required.</p>
The proposed association, with the help text preserved:
<input type="text" id="edit-name" aria-invalid="true"
aria-describedby="edit-name--error-message edit-name--description">
<p class="description" id="edit-name--description">We use this name on your profile.</p>
<p class="error-message" id="edit-name--error-message">Name field is required.</p>
A group uses the fieldset, not the options:
<fieldset aria-describedby="edit-colour--error-message edit-colour--description">
<legend>Favourite colour</legend>
<p class="description" id="edit-colour--description">Choose one.</p>
<label><input type="radio" name="colour" value="red"> Red</label>
…
<p class="error-message" id="edit-colour--error-message">Favourite colour field is required.</p>
</fieldset>
What the association adds
No association
textbox "Name"
description: "We use this name on your profile." (help only)
aria-describedby
textbox "Name"
description: "Name field is required. We use this name on your profile."
Group error
group "Favourite colour"
description: "Favourite colour field is required. Choose one."
The error is first in the description so it is heard before the help. Existing description tokens are kept.
Test it with a screen reader
VoiceOver on macOS
- Open No association and Tab to each field. You hear the label and, for Name, the help text; the visible error is not part of the description.
- Open aria-describedby and Tab again. Name should now speak the error and then the help; the radio group should speak the group error and help.
- Compare with aria-errormessage. Depending on the screen reader, the error may only be available in browse mode; the help text remains the focus description.
NVDA on Windows
- Open No association and Tab to the fields. The error text is not in the description.
- Open aria-describedby and Tab. The error and help should be announced with the field; NVDA+Tab or reading on reaches the visible error text too.
- Open Group error and Tab into the radio group. The group error and help should be announced; the individual options do not repeat them.
This page does not simulate speech. Automated checks and DOM assertions do not prove what a screen reader announces; the Lab's real VoiceOver evidence for the message landmark is on a different issue.
What this demonstration is not
- It is not Drupal. It does not load Drupal, the Form API or a theme. The visible design is a stand-in, not
default_adminor Stark. - It does not submit, validate or rebuild the form; the errors are static. It does not show AJAX, BigPipe, managed files or tables.
- It is not a conformance claim. The 2026-12-01 Lab candidate uses
aria-describedbyonly; aria-errormessage is shown as an alternative because it is still proposed elsewhere. - The production implementation and its tests are in the Lab report, not in this page.
Source and evidence
- Drupal core issue #3083103
- Merge requests: !15692 · !7080 · !1063
- Lab report, including the recursion experiment, the candidate patches and the test matrix.