Promo Code Errors in the Cart: Associate the Message or Lose the Sale

The shopper pastes a code from an email, taps apply, and the field border turns red. No text, or text placed three elements away where no assistive technology will find it. Sighted shoppers guess the code expired. A screen reader user hears nothing change on the page and guesses the button did not work. Both guesses end the same way often enough: the tab closes with the cart still full.

What 3.3.1 actually requires here

WCAG 2.2 Success Criterion 3.3.1 Error Identification, at Level A, requires that an input error be described to the user in text and that the item in error be identified. Colour alone does not count as text. For the promo field that means three concrete things: a real text message near the field, aria-invalid set to true on the input, and the message container referenced from the input with aria-describedby so the error is announced with the field when it receives focus.

The WebAIM Million 2025 report keeps finding low contrast text and missing form labels among the most common home page errors, year after year, across a million pages. Promo error text is a repeat offender on both counts: it is often set in a light red that fails the 4.5 to 1 contrast ratio for normal text, on top of being unassociated with its field.

Announce the result, keep the evidence

Applying a code is a status change, so WCAG 4.1.3 Status Messages applies as well. Wrap the result area in a live region, role status is enough, so the failure or the discount is announced without moving focus. And leave the typed code in the field. Clearing it destroys the one thing the shopper needs to check: whether the O they typed was a zero. Our post on the cart quantity stepper and its accessible name covers the same pattern for quantity changes, where the announcement, not the visual flash, is what makes the control usable.

Say what failed in the message. Code not recognised, code expired on a stated date, and code not valid for items in this cart are three different problems with three different next steps. One generic invalid code message forces the shopper to debug your promotion rules.

Test it the way it breaks

Run the check with a keyboard and a screen reader, or at minimum with your browser accessibility tree open. Tab to the promo field, submit a bad code, and confirm focus behaviour, the announcement, and the describedby link all fire. Then submit a good code and confirm the success is announced the same way. The failure path is the one teams skip, and it is the one that carries the legal and the revenue risk, the same lesson as our checkout error summary and focus management post, where the summary only helped once focus actually moved to it.

Keep reading: cart quantity stepper and its accessible name, checkout error summary and focus management.

Frequently asked questions

How should a promo code error be written for accessibility?

In plain text that names the problem, placed next to the field, referenced from the input with aria-describedby, with aria-invalid set on the field. Say whether the code was not recognised, expired, or not valid for the cart contents, because each has a different fix for the shopper.

Does a red border count as an error message under WCAG?

No. WCAG 3.3.1 requires the error to be described in text and the item identified. Colour alone is not text, and it also fails shoppers who cannot perceive the colour change. Use colour as reinforcement, never as the only signal.

Should the promo field clear after a failed code?

No. Leave the typed code visible so the shopper can check it character by character, since a mistyped code is the most common cause of failure. Clearing the field forces them to find the original code again and retype it blind.

What live region should announce a promo result?

A role of status, which maps to aria-live polite, is the right default. It announces the success or failure without moving focus or interrupting. Reserve assertive announcements for errors that block the whole checkout, not for a single field result.