Skip to content
easeweb
Search topics

Forms replaced by a thank-you that is never announced

On success, a newsletter form is swapped for a thank-you paragraph that nothing announces, and the Subscribe button that had focus goes with it, so focus falls to the page.

WCAG 2.2
SC 4.1.3AA· new in 2.1
Required by
EN 301 549 (EU)
Broken signup.replaceWith(thanks);
The accessibility problem illustrated: No vision:Where am I now?
01

The problem

Screen reader users press Subscribe and hear nothing, and the button they were on is gone, so they don't know whether they signed up or where they are on the page.

02

Try it

Press Subscribe, listen, then press Tab.

The panels under the page show where focus went and what a screen reader says. Is the thank-you heard, and where does the next Tab start?

Broken Can you fix this?

BrokenA thank-you that replaces the form

Fernhill Books

New titles arrive every Thursday. Open daily, 9 to 6.

Opening hours and directions

Screen reader says:

(Press Subscribe)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

When the result takes the form's place, move focus to it; or keep the form and write the result into its status line.

  1. 1Never remove the focused button without giving focus to what took its place.
  2. 2Put the whole result in the text that takes focus, or in a status region that was there before the send.
  3. 3Keep failures in the status line, with focus on the button.
Before A thank-you that replaces the form
<section aria-labelledby="signup-title">  <h2 id="signup-title">Sign up for our newsletter</h2>  <form id="signup">    <label for="signup-email">Email address</label>    <input id="signup-email" name="email" type="email" autocomplete="email" required>    <button>Subscribe</button>  </form>  <p id="signup-message" role="status"></p></section>
After

A thank-you that takes focus

<section aria-labelledby="signup-title">  <h2 id="signup-title">Sign up for our newsletter</h2>  <form id="signup">    <label for="signup-email">Email address</label>    <input id="signup-email" name="email" type="email" autocomplete="email" required>    <button>Subscribe</button>  </form>  <p id="signup-message" role="status"></p></section>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Design ideas

A thank-you can take the form’s place, and take focus with it.

Three ways to replace the form with a thank-you. Tab to Subscribe and press Enter in each: two move the focus ring onto the thank-you, and one leaves it nowhere.

In the design file

  • Mark where the keyboard lands once the thank-you appears, and draw it with its focus ring.
  • Write the thank-you as one sentence that says what happened and what to do next.
  • Draw the failed send too, with the form still in place and the message under it.
  • Write the ratios next to the thank-you’s colours, at least 4.5:1 for its words.

Passes

  • A card with the next step The form gives way to a white card with a teal tick, “Check your inbox” and the address, and a “Use another address” button that brings the form back. The card takes focus as it appears, so its first line is read and the next Tab reaches the button. Teal on white is 9.08:1.
  • A centred heading with an envelope An envelope in a pale teal circle sits over “You’re on the list” in large type and one line on what comes next, all centred where the form was. The heading takes focus, so it is read first and the line after it follows. The ink on white is 14.66:1.

Fails

  • “Subscribed!” rising into the form’s placeWCAG 4.1.3 The form goes, and a tick with “Subscribed!” rises into its place in about a third of a second. The movement shows the change and stops, but nothing takes focus: after Enter, no ring shows anywhere, and a screen reader hears nothing. Focus the new line and the movement can stay. The sample brings the form back after four seconds.
05

Verify the fix

4 checks, no mouse.

Test with: Screen reader, Keyboard

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the form component, its script or the embed changes.

Limits

Screen readers and browsers differ in what they read when focus moves to a paragraph, and in where they continue after an element is removed. This pattern covers one short form whose success replaces it in place. A form that stays on the page and announces its result is covered in form success and error messages that are never announced, and a form that goes to a new page or view in single-page app route changes that are never announced. Test your real forms, including embedded ones, with the screen readers your users use.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work