The overview ended by asking what a screen reader user gets from the Donate a Tool form after an invalid entry. Rosa Delgado found out. She offered the library her hedge trimmer but left the ending off her email address, and the server sent the form back with a red border around the field and “Invalid email.” under it.
Anyone who can see the page knows which field is wrong. In this lesson, you’ll predict from the markup what a screen reader gets at a field, then connect the form’s instructions, required markers, and error text so the screen reader gets them too. Kwame’s form already has the labels and input types from Forms and Accessibility in HTML and CSS. Start with the field as Kwame left it.
Read a Field the Way the Browser Exposes It
A screen reader works from what the browser exposes in the accessibility tree. For a form field, that’s its role, name, value, states such as required and invalid, and an optional description.
On focus, the reader builds its announcement from these, in its own words and as its settings allow. A paragraph next to the field isn’t part of that unless the markup connects it.
Open donate.html from the starting site in your live preview. Kwame saved it as the server returned it to Rosa, with her answers. Here are the email field and the paragraph above the form:
<p class="form-help">
Give the tool's brand and model if you know them. We'll
email you within two days to arrange a drop-off.
</p>
<form class="donate-form" action="/donate" method="post">
<!-- The name field -->
<div class="field">
<label for="email">Email <span class="req">*</span></label>
<input type="email" id="email" name="email"
autocomplete="email" value="rosa.delgado@example"
class="invalid">
<p class="error">Invalid email.</p>
</div>
<!-- The tool and condition fields, and the button -->
</form>
The stylesheet colors .req and .error red and gives .invalid a red border. Amara Okafor, another member, uses a screen reader and presses Tab to move from field to field.
Select the email field in the Elements panel and open the Accessibility tab. In this lesson’s run in Chromium on November 29, 2026, it shows a textbox named “Email *“, with Required false, Invalid user entry false, and no description:

None of the three signals reaches Amara. The asterisk is only a character in the name, which a screen reader may read as a symbol name or skip. Without required, nothing marks the field as required. The red border comes from a class, so it only changes the look. And the error paragraph isn’t connected, so Amara, tabbing between fields, never lands on it.
From here on, the pane is your test: anything the field should say must show up in it.
Mark Required Fields and Put Instructions First
3.3.2 Labels or Instructions, at Level A, asks for labels or instructions wherever a form needs input. Kwame’s form has both, but neither reaches Amara intact: the asterisk is unexplained, and the instructions sit above the form, far from the two fields they describe.
Explain the asterisk in text before the fields, so sighted visitors new to the convention know what it means. Then add the required attribute to each required field, which gives it the required state and turns on the browser’s own check for an empty field.
With the state in place, the asterisk only repeats it, so hide it with aria-hidden="true", which removes it from the accessibility tree and changes nothing else.
An instruction belongs right before its field, where everyone meets it before typing. To make it part of the field, use aria-describedby, which joins a field to the id of an element whose text becomes the field’s description.
Replace the paragraph above the form with the line about the asterisk, and give the tool field its instruction:
<p class="form-help">Fields marked * are required.</p>
<form class="donate-form" action="/donate" method="post">
<!-- The name and email fields -->
<div class="field">
<label for="tool">
Tool <span class="req" aria-hidden="true">*</span>
</label>
<p class="hint" id="tool-hint">
Give the brand and model if you know them.
</p>
<input id="tool" name="tool" value="Hedge trimmer"
required aria-describedby="tool-hint">
</div>
The asterisk line stays at the top, unconnected, because it applies to every field and each required field carries its own required state. Add aria-hidden="true" to the name field’s asterisk and required to its input. The email field gets the rest of the old paragraph as its instruction in the next section.
Word the Error and Connect It
An error message has two jobs. 3.3.1 Error Identification, at Level A, asks you to identify the field and describe the detected error in text. 3.3.3 Error Suggestion, at Level AA, asks for a way to fix it when one is known.
“Invalid email.” tells Rosa that something is wrong but not what. The browser’s own check accepted rosa.delgado@example, because type="email" doesn’t require a dot after the @. The library’s server is stricter: it wants a domain ending such as .com, so it knows what’s missing. The revised message below describes that problem for 3.3.1 and suggests the fix for 3.3.3.
Then connect the message as you would an instruction, with two attributes you’ve seen before on an error. aria-invalid="true" gives the field its invalid state. This needs no JavaScript, because the server writes the attribute into the page it sends back.
aria-describedby takes more than one id, separated by spaces, so one description can hold both the instruction and the error. Change the email field to this:
<div class="field">
<label for="email">
Email <span class="req" aria-hidden="true">*</span>
</label>
<p class="hint" id="email-hint">
We'll email you within two days to arrange a drop-off.
</p>
<input type="email" id="email" name="email"
autocomplete="email" value="rosa.delgado@example"
class="invalid" required aria-invalid="true"
aria-describedby="email-hint email-error">
<p class="error" id="email-error">
Enter the whole email address, including its ending,
such as .com or .org.
</p>
</div>
The error sits after the field, next to what Rosa typed. As the server’s response to a failed submission, it stays as written: fixing the address doesn’t clear it. The server’s next response drops the error, its ID in aria-describedby, and aria-invalid, but keeps the hint. Clearing it as Rosa types would need JavaScript.
Save, and select the email field again:

The name is now “Email”, without the asterisk. Required and Invalid user entry are both true, and the description is the instruction followed by the error, in the order of the IDs in aria-describedby. The pane truncates a long description, so widen DevTools to read it all. Either order works, as long as both are connected; swapping the IDs puts the error first.
When Amara reaches the field, her screen reader can now tell her what it is, that it’s required and wrong, and what to do about it. Here are the parts of the markup that reach the field and those that don’t:
To practice the wording, the button below opens a chat with the AI mentor. Give it your own error message, and it’ll say how it holds up:
Check the Form by Keyboard and Screen Reader
A form isn’t done until you’ve used it as its visitors do: by keyboard, then with a screen reader. Click in the page above the heading and press Tab through the form. Focus should visit the name, email, and tool fields, then the Condition menu and the Offer this tool button, the order Chromium gave in this lesson’s run. Each control should have a visible focus ring.
Now select the other fields in the Elements panel. In the same run, the tree had:
- Your name: A textbox named “Your name”, required, with no description
- Tool: A textbox named “Tool”, required, described by the brand-and-model instruction
- Condition: A combobox named “Condition”, not required
Then turn on your screen reader and do the same walk. On macOS, Cmd+F5 turns VoiceOver on or off (Apple’s VoiceOver User Guide). On Windows, Ctrl+Alt+N starts NVDA, and Ins+Tab announces the focused field again (NVDA’s User Guide).
Press Tab and listen for each field’s role, name, states, and description, as the pane showed them. Each reader words and orders these its own way and may read the value too, so listen for each part rather than exact words. If one is missing, check the pane first, then the reader’s settings.
To practice reading fields from their markup, the button below starts a short quiz with the AI mentor. It shows you a field’s markup, and you say what a screen reader gets:
Check Your Understanding
Try these before you open the answers:
-
Kwame adds a phone field to the form. What name, states, and description does the tree give it?
Language: HTML<label for="phone">Phone <span class="req">*</span></label> <input type="tel" id="phone" name="phone" aria-describedby="phone-hint"> <p id="phone-hint"> We'll text you only if email doesn't reach you. </p> -
Kwame wants to change the email error to “Please check this field.” Which of 3.3.1 and 3.3.3 does it fall short of, and why?
- The email field has
requirednow. Why does the red asterisk stay on screen?
- The name is “Phone *“: the asterisk is part of the label’s text. Required is false without the
requiredattribute. The description is the hint, even though it comes after the field, becausearia-describedbyconnects byid, not position. To finish it, addrequiredto the input andaria-hidden="true"to the asterisk, and move the hint before the field so sighted visitors read it first. - Both. It doesn’t describe the problem (3.3.1), and it doesn’t say how to fix it, though the server knows (3.3.3).
- The required state reaches only assistive technology. Sighted visitors still need to see which fields are required, and the explained asterisk shows them, while
aria-hidden="true"keeps it out of the name.
The Donate a Tool form now tells everyone what’s required and what went wrong, on the field itself. After a failed submission, the server’s error rightly shows straight away. On a fresh form, though, the browser’s own checks shouldn’t flag fields before anyone has used them.
In the next lesson, Style Invalid Fields Beyond Color, you’ll use more than color to show which fields the browser finds invalid, but only once someone has left them.