In the last lesson, the browser flagged mistakes as people made them. Only the library’s server can find some errors. Mei Lin Chen offers a hedge trimmer from [email protected], which the browser accepts. The server knows that domain looks misspelled and that the library has enough hedge trimmers, so it sends the form back with an error on each field.
In this lesson, you’ll add an error summary at the top of that page, so everyone learns at once what went wrong and can jump to each field. Start with the page the server returns.
Start the Page With What Went Wrong
An error next to its field only helps someone who reaches that field. Someone using a screen reader or magnifier starts at the top, unaware that anything failed.
Open donate.html from this lesson’s starting site in your live preview. It’s the page the server returned to Mei Lin. Each invalid field has aria-invalid="true" and its error connected, as in the first lesson:
<input type="email" id="email" name="email"
autocomplete="email" value="[email protected]"
required aria-invalid="true"
aria-describedby="email-hint email-error">
<p class="error" id="email-error">
<span class="error-icon" aria-hidden="true">!</span>
Check the email address. Did you mean [email protected]?
</p>
The last lesson’s stylesheet hides each .error until its input matches :user-invalid, and nobody has used these fields yet. So Kwame added two rules that follow the server’s attribute instead:
[aria-invalid="true"] {
border-color: var(--color-error);
}
[aria-invalid="true"] + .error {
display: block;
}
These errors describe the server’s last response, so they stay while Mei Lin edits. Nothing on the page removes aria-invalid or updates the summary. When she submits again, the server sends a new page, without the markers and messages for the fields she fixed.
Now add the summary right after the <h1>:
<section class="error-summary"
aria-labelledby="error-summary-title">
<h2 id="error-summary-title">There's a problem with 2 fields</h2>
<ul>
<li>
<a href="#email">Check the email address. Did you mean
[email protected]?</a>
</li>
<li>
<a href="#tool">We have enough hedge trimmers for now.
Offer a different tool.</a>
</li>
</ul>
</section>
A <section> named by its heading through aria-labelledby becomes a region landmark, which screen reader users can jump to.
Each link points to a field’s id and repeats its error, so the summary identifies every error and suggests its fix, as 3.3.1 Error Identification and 3.3.3 Error Suggestion ask.
Start the <title> with Error: too, so the tab says the form came back. The starting styles.css already styles .error-summary. Save:

The server also fills in Mei Lin’s answers, with value on the text inputs and selected on the Condition option she chose. That way, she retypes nothing, in the spirit of 3.3.7 Redundant Entry.
Follow a Link to Its Field
A summary helps only if its links work by keyboard. Click in the page above the heading and press Tab. In this lesson’s run in Chromium on November 29, 2026, focus reached both links before the fields. Pressing Enter on the second link moved focus into the Tool field, because a link to an id focuses its target when the target can take focus. Pressing Tab again moved focus to Condition.
Then select the <section> in the Elements panel and open the Accessibility tab:

The summary has the region role and gets its name from the <h2>. Now turn on your screen reader as in the first lesson, and reload the page before each check, so you start at the top:
- Find the landmark: In NVDA’s browse mode, press D twice to move past the main landmark to the region, as described in NVDA’s User Guide. In VoiceOver, press Ctrl+Option+U for the rotor, Right to the Landmarks list, Down to the region, then Enter, as described in Apple’s VoiceOver User Guide. Listen for its name.
- Follow a link: Press Tab twice, then Enter, and focus lands in Tool. In this run, Chromium’s tree had a textbox named “Tool”, required and invalid, described by its instruction, then its error. Listen for each part, since your screen reader’s exact words may differ.
HTML can also focus the summary on load, with autofocus on a section made focusable by tabindex="-1". Announcing errors as they happen and managing focus as the person types need JavaScript, so this course doesn’t cover those behaviors. You may also meet aria-errormessage, made for connecting errors, but screen readers support it unevenly, so aria-describedby stays the dependable choice.
The button below opens a chat with the AI mentor. Describe your own form and its server’s errors, and it’ll help you word a summary:
Check Your Understanding
Try these before you open the answers:
- The server also rejects the name field. What changes does the summary need?
- Why does each link repeat the field’s error instead of saying “Email”?
- Add a new first item linking to
#donor-name, with the name’s error as its text, and update the heading to count 3 fields. The field also needsaria-invalid="true"and its error connected. - Each link should identify its error and suggest the fix on its own, for 3.3.1 and 3.3.3. “Email” only names the field.
The donate form now shows its errors in text, whether the browser or the server finds them. In the next exercise, Make the Donate Form Accessible, you’ll build Kwame’s whole form yourself, from its instructions to the server’s summary. It’s the course’s first coding exercise. You’ll edit files in the browser and run tests on your markup, and the exercise’s Contents tab explains how that works.