Accessible form labels and error messages
By ValleyFill · November 14, 2026
Last checked: November 12, 2026. The success criteria quoted below are from Web Content Accessibility Guidelines (WCAG) 2.1, W3C Recommendation of 06 May 2025. The practical guidance is from the W3C Web Accessibility Initiative’s Forms Tutorial, last updated 27 March 2026. Each linked page was opened on November 12, 2026. 1 2 5 6 7
Contact forms, registrations and checkout pages are often where a visit succeeds or stalls. A field that only a sighted mouse user can interpret, or an error that appears only as a red outline, can leave some people without a way to finish. This article looks at what WCAG 2.1 says about labels and error messages, and at the before-and-after HTML the WAI Forms Tutorial points toward. The samples are illustrations, not live forms and not a complete implementation. Following these steps does not by itself make a form conformant with WCAG 2.1 or any law; test with real users and assistive technology. 7
The success criteria in play
These six criteria are the ones that most directly cover form labels and error messages. The wording is quoted from WCAG 2.1. Four are Level A; two are Level AA. 1 2 3 4 5 6
- 1.3.1 Info and Relationships (Level A). “Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.” A visible label sitting next to a field is such a relationship. 1
- 3.3.2 Labels or Instructions (Level A). “Labels or instructions are provided when content requires user input.” 2
- 4.1.2 Name, Role, Value (Level A). The name and role of each user interface component, including form elements, “can be programmatically determined.” A note on the criterion says it is “primarily for web authors who develop or script their own user interface components,” and that “standard HTML controls already meet this success criterion when used according to specification.” 3
- 2.4.6 Headings and Labels (Level AA). “Headings and labels describe topic or purpose.” Associating a label is not enough if the text itself is vague, such as “Field 1.” 4
- 3.3.1 Error Identification (Level A). “If an input error is automatically detected, the item that is in error is identified and the error is described to the user in text.” 5
- 3.3.3 Error Suggestion (Level AA). “If an input error is automatically detected and suggestions for correction are known, then the suggestions are provided to the user, unless it would jeopardize the security or purpose of the content.” 6
The Forms Tutorial’s opening page lists 1.3.1, 2.4.6, 3.3.2 and 4.1.2. Its validation page lists 3.3.1, and its notification page lists 3.3.1 and 3.3.3. 7 11 12
Give every control a label, and associate it in the code
The tutorial’s labeling page opens with: “Provide labels to identify all form controls, including text fields, checkboxes, radio buttons, and drop-down menus. In most cases, this is done by using the label element.” It adds: “Whenever possible, use the label element to associate text with form elements explicitly. The for attribute of the label must exactly match the id of the form control.” That association, the same page says, lets web browsers “provide the label as a larger clickable area” and lets assistive technology “refer to the correct label when presenting a form control.” 8
A common weak pattern is a visible heading or placeholder that is not tied to the field in the markup. Placeholder text, the instructions page says, “is not a replacement for labels.” Assistive technologies “do not treat placeholder text as labels,” and “it disappears from form fields when users start entering text.” If that text contains instructional information or examples, that “makes it more difficult for users to check their responses before submitting the form.” 9
Before. The words “Email address” appear on the page, but only as a separate paragraph and as placeholder text. Neither is a programmatically associated label.
<p>Email address</p>
<input type="text" name="email" placeholder="Email address">
After. A label is associated with the field through matching for and id values.
<label for="email">Email address</label>
<input type="text" name="email" id="email">
The tutorial’s preference is a visible label: “most users prefer or even need visible labels to understand the form.” Where a visible label would be redundant, for example a search field placed directly beside a “Search” button, the labeling page documents visually hidden label text and, in that kind of situation only, aria-label or aria-labelledby. It also records a limit: aria-label “is not conveyed to visual users” and “should therefore only be used when the label of the control is clear from the surrounding content.” The title attribute is “generally less reliable and not recommended.” 8
Put instructions where they can be read
Success Criterion 3.3.2 asks for labels or instructions, not labels alone. The instructions page says to “Indicate any required and optional input, data formats, and other relevant information.” Instructions that apply to the whole form should sit before the form element, because “Screen readers often switch to ‘Forms Mode’ when they are processing content within a form element” and in that mode “usually only read aloud form elements.” 2 9
For a required field, the validation page adds the HTML required attribute and also puts “(required)” in the label, “to inform users that don’t use assistive technology or use older web browsers that do not support the HTML5 required attribute.” A format hint can sit in the label itself, or next to the field and referenced with aria-describedby. “Information referenced by this attribute is made available to the users after the label and other information is announced.” 9 11
Before. A red asterisk and a placeholder are the only hints that the field is required and that a month-and-year format is expected. If the placeholder disappears as someone types, the format reminder goes with it.
<span class="required">*</span>
<input type="text" name="event-date" placeholder="MM/YYYY">
After. The label states that the field is required, the required attribute is set, and a persistent format instruction is tied to the field with aria-describedby.
<label for="event-date">Event date (required)</label>
<input type="text" name="event-date" id="event-date"
required aria-describedby="event-date-hint">
<span id="event-date-hint">Use the format MM/YYYY.</span>
Group related controls so the question is part of the name
Individual radio buttons can each have a label (“Morning”, “Afternoon”) and still leave out the question they answer (“Preferred session”). The grouping page says grouping “makes forms more understandable for all users,” and tells authors to use fieldset and legend. “Radio button groups should always be grouped using fieldset.” That is one way to expose, in the code, a relationship already visible on the screen, which is what 1.3.1 addresses. 1 10
Before. A paragraph supplies the question visually, but it is not tied to the radio group in the markup.
<p>Preferred session</p>
<input type="radio" name="session" value="morning" id="am">
<label for="am">Morning</label>
<input type="radio" name="session" value="afternoon" id="pm">
<label for="pm">Afternoon</label>
After. A fieldset wraps the group and a legend names it. Each option still has its own label.
<fieldset>
<legend>Preferred session</legend>
<div>
<input type="radio" name="session" value="morning" id="am">
<label for="am">Morning</label>
</div>
<div>
<input type="radio" name="session" value="afternoon" id="pm">
<label for="pm">Afternoon</label>
</div>
</fieldset>
The same page cautions that some screen readers announce the legend with every option, some announce it once, and a few may not. It suggests keeping the legend short, and making each option label understandable on its own, “without repeating the legend in every label.” 10
When an error is detected, identify the field and describe the problem in text
A red outline around a field can help some people, but Success Criterion 3.3.1 is not met by color or outline alone. The criterion requires two things, both in text: the item in error is identified, and the error is described. 5
The notification page offers several complementary techniques: mention errors in the page’s main heading or title; list them at the top of the form, before the fields; and give in-line messages at or near the control. Each item in an error list, it says, should refer to the field’s label, describe the error, indicate how to correct it, and include an in-page link to the control. When a list of errors is inserted dynamically at the top of the page, “this container should have the role attribute set to alert.” Fields can be associated with their message through aria-describedby. The same page lists “ARIA21: Using aria-invalid to Indicate An Error Field” among its techniques. 12
Success Criterion 3.3.3 goes a step further when a correction is known: provide that suggestion, unless doing so “would jeopardize the security or purpose of the content.” A message that only says “Invalid input” identifies a problem; “Enter a 5-digit ZIP code, for example 62701” also suggests how to fix it. The exception is the criterion’s own wording: suggestions are provided “unless it would jeopardize the security or purpose of the content.” 6
Before. A CSS class draws a red border. There is no text that names the field or explains what to change.
<label for="zip">ZIP code</label>
<input type="text" id="zip" name="zip" class="invalid">
<!-- A red border is the only indication that something is wrong. -->
After. The error is described in text, tied to the field with aria-describedby, and marked with aria-invalid. The message includes a known format and an example, which is the kind of suggestion 3.3.3 describes.
<label for="zip">ZIP code</label>
<input type="text" id="zip" name="zip"
aria-invalid="true" aria-describedby="zip-error">
<p id="zip-error">Enter a 5-digit ZIP code, for example 62701.</p>
The notification page’s in-line example follows the same idea, with a message such as “Use the format MM/YYYY.” After a submission with errors, it notes, “it is convenient to set the focus to the first input element that contains an error.” That focus move is part of the interaction, not something a static HTML snippet can show. 12
A short way to review a form
The questions below follow the criteria and the tutorial. They are a review aid, not a conformance test and not a statement of what any law requires of a particular site.
- Does each control have a label associated in the code, preferably with
labeland matchingfor/idvalues? 8 - Does that label describe the purpose of the field, not a generic name? 4
- Are required fields and expected formats stated in text that remains available, not only in a placeholder or a color cue? Are whole-form instructions placed where they can be read before the fields? 9 11
- Are related radio buttons (and similar groups) wrapped in a
fieldsetwith a shortlegend? 10 - If the form detects an error, is the field identified and is the error described in text, not only by a red border? 5 12
- If a correction is known, and giving it would not jeopardize the security or purpose of the content, does the message include that suggestion? 6
If you want to look at your own pages, our free tools, including the color contrast checker, and the Title II Snapshot are a place to start. Our free tools and automated audits can help you find some issues to fix. They are not legal advice or a compliance guarantee.
About us and this post. ValleyFill sells automated accessibility audits and monitoring, and the Title II Snapshot is our own automated tool. Automated tools, ours included, cannot make a site conformant on their own; they find only some barriers. A tool can often notice that a field has no accessible name. It cannot tell you whether a label describes the field’s purpose, or whether an error message is clear enough to act on.
Sources
Each source was opened and checked on November 12, 2026. The success criteria are quoted from the WCAG 2.1 recommendation. The Forms Tutorial is W3C guidance on implementing those criteria; it is not itself a success criterion.
- WCAG 2.1 Success Criterion 1.3.1 Info and Relationships (Level A). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 3.3.2 Labels or Instructions (Level A). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 4.1.2 Name, Role, Value (Level A). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 2.4.6 Headings and Labels (Level AA). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 3.3.1 Error Identification (Level A). W3C Recommendation, 06 May 2025.
- WCAG 2.1 Success Criterion 3.3.3 Error Suggestion (Level AA). W3C Recommendation, 06 May 2025.
- W3C Web Accessibility Initiative, Forms Tutorial (page last updated 27 March 2026).
- WAI Forms Tutorial: Labeling Controls.
- WAI Forms Tutorial: Form Instructions.
- WAI Forms Tutorial: Grouping Controls.
- WAI Forms Tutorial: Validating Input.
- WAI Forms Tutorial: User Notification.
Related ValleyFill guides
- WCAG 2.1 AA in plain language
- WCAG plain language: what reading level means at AA and AAA
- Title II Snapshot vs a full accessibility audit: what each one shows
- Accessibility standards guide
This is general information, not legal advice. ValleyFill is not a law firm. For advice about your situation, talk to a lawyer.