Checkout Error Summaries: Focus Has to Go Where the Error Is

When checkout validation fails, focus has to go to the error summary, the summary has to link to each failing field, and each field has to carry its own error in text tied to the input with aria-describedby. Skip the summary and keyboard and screen reader users are left tabbing through a long form hunting for a red outline they may not be able to see. WCAG 3.3.1 and 2.4.3 are the criteria doing the work here.

The shopper who cannot find the error

Submit a checkout form with a mistyped card number and watch where you end up. On many stores, nowhere moves. The page redraws, an error message appears at the top or beside a field, and focus stays on the pay button. A sighted mouse user recovers in seconds. A keyboard user starts tabbing from the top with no map, and a screen reader user may never encounter the message at all if it was inserted where their cursor is not. This is the same class of failure as the drawer problem in our focus trap check: the interface changed somewhere the user was not.

The pattern that works is old and specific

Move focus to an error summary at the top of the form on submit. Give it tabindex of minus one so it can receive focus without entering the tab order, and write it as a heading plus a list: how many errors, each one a link to its field. Activate a link and focus lands in the field, not near it. Then, at the field itself, repeat the error in plain text, associated with the input using aria-describedby, and mark the field invalid with aria-invalid. GOV.UK's design system documented this pattern years ago and it remains the reference implementation most practitioners test against.

Two details separate a working summary from theatre. The summary must appear on every failed submit, including the second one, rebuilt with the current errors, not left over from the first attempt. And error text must say how to fix the field, expiry date in the future is an instruction, invalid input is a shrug. WCAG 3.3.1, Error Identification, requires the error be described in text. WCAG 3.3.3 asks for a suggestion where one is known. A card expiry has a known suggestion, so give it.

What not to do

Do not rely on colour, which fails low vision users and is explicitly not enough under WCAG 1.4.1, Use of Color. Do not clear the shopper's entries on a failed submit, which punishes everyone and is brutal for users who type slowly. Do not validate aggressively on every keystroke and announce each character's verdict through a live region, which floods screen reader users with noise; our autocomplete announcements post covers that balance. Validate on submit, summarise, move focus once, and let the shopper work the list. Then retest the whole flow with the keyboard unplugged from the mouse, because that is the only version of the test that counts.

Frequently asked questions

Where should focus go after a failed checkout submit?

To the error summary at the top of the form, which lists each error as a link to its field. The summary needs tabindex minus one to receive focus. From there the shopper can work through the errors in order instead of hunting through the form.

What makes a good checkout error message?

It names the field, says what is wrong in plain words, and says how to fix it when the fix is known. Card expiry dates, postcode formats, and missing required fields all have known fixes. Messages like invalid input fail WCAG 3.3.3's expectation that a known suggestion be provided.

Do errors need more than red highlighting?

Yes. WCAG 1.4.1, Use of Color, says colour cannot be the only way information is conveyed. Each error also needs text, and for assistive technology users that text must be programmatically tied to the field, usually with aria-describedby, plus aria-invalid on the input.

Should checkout validate as the shopper types?

Gently, at most. Aggressive live validation interrupts typing and can flood screen reader users with announcements. The reliable pattern is full validation on submit with a focus managed error summary, plus optional inline checks when a field is left, not while it is being filled.