Accessible checkout: 8 common problems and how to fix them, with code

Last updated:

If a customer can't get through your checkout, nothing else on the site matters. Checkouts are also where automated scans help least, because errors only appear when someone fills the form in wrongly. These are the problems we see most, with before and after code your developer can apply to any platform.

1. Fields with placeholders instead of labels

A placeholder disappears as soon as someone types, and many screen readers don't treat it as a label. Every field needs a real <label> connected by for and id:

Before

<input type="text" name="email" placeholder="Email">
<input type="text" name="zip" placeholder="Postcode">

After

<label for="email">Email</label>
<input id="email" type="email" name="email" autocomplete="email" required>

<label for="zip">Postcode</label>
<input id="zip" type="text" name="zip" autocomplete="postal-code" required>

2. Missing autocomplete values

WCAG 1.3.5 asks that fields collecting personal data say what they are, so browsers can fill them in. This helps everyone, and especially people with motor or memory impairments. Use the standard values:

<input name="first"   autocomplete="given-name">
<input name="last"    autocomplete="family-name">
<input name="street"  autocomplete="address-line1">
<input name="city"    autocomplete="address-level2">
<select name="country" autocomplete="country">…</select>
<input name="phone"   type="tel" autocomplete="tel">
<input name="code"    inputmode="numeric" autocomplete="one-time-code">

3. Errors shown only in red

A red border tells nothing to someone who can't see red, and "Invalid" doesn't say how to fix it. Put the error in text, next to the field, linked to it, and say what to do:

Before

<input id="email" class="error" style="border-color:red">
<span style="color:red">Invalid</span>

After

<label for="email">Email</label>
<input id="email" type="email" autocomplete="email"
       aria-invalid="true" aria-describedby="email-error">
<p id="email-error" class="field-error">
  Enter an email address like name@example.com
</p>

When the form is submitted with several errors, show a summary at the top, move focus to it, and link each item to its field:

<div id="error-summary" role="alert" tabindex="-1">
  <h2>There are 2 problems with your details</h2>
  <ul>
    <li><a href="#email">Enter an email address like name@example.com</a></li>
    <li><a href="#zip">Enter your postcode</a></li>
  </ul>
</div>
<script>document.getElementById('error-summary').focus();</script>

4. Delivery and payment options that aren't real controls

Clickable boxes built from divs can't be selected with a keyboard, and screen readers don't say which one is chosen. Use a group of radio buttons; you can still style them as boxes:

Before

<div class="shipping-option selected" onclick="choose('dhl')">DHL – €4.90</div>
<div class="shipping-option" onclick="choose('pickup')">Pick-up point – €2.90</div>

After

<fieldset>
  <legend>Delivery method</legend>
  <input type="radio" id="ship-dhl" name="shipping" value="dhl" checked>
  <label for="ship-dhl">DHL home delivery, €4.90</label>
  <input type="radio" id="ship-pickup" name="shipping" value="pickup">
  <label for="ship-pickup">Pick-up point, €2.90</label>
</fieldset>

5. Quantity buttons and totals that change silently

"+" and "−" buttons need names that say what they change, and changes to the total should be announced:

Before

<button onclick="dec()">−</button>
<input value="1">
<button onclick="inc()">+</button>

After

<button type="button" aria-label="Decrease quantity of Linen shirt">−</button>
<label class="visually-hidden" for="qty-1">Quantity of Linen shirt</label>
<input id="qty-1" type="number" inputmode="numeric" min="1" value="1">
<button type="button" aria-label="Increase quantity of Linen shirt">+</button>
<p role="status" class="visually-hidden" id="cart-status"><!-- "Total updated: €58.80" --></p>

6. Making people type the same thing twice

WCAG 2.2 (3.3.7 Redundant Entry) asks you not to make customers re-enter information they already gave in the same process. The classic case is the billing address:

<input type="checkbox" id="same" name="billing_same" checked>
<label for="same">Billing address is the same as delivery address</label>

7. Logins, codes and CAPTCHAs

WCAG 2.2 (3.3.8 Accessible Authentication) says signing in must not depend on remembering or transcribing something, unless there's help. In practice: allow pasting into password and code fields, support password managers (autocomplete="current-password", "one-time-code"), offer guest checkout, and don't use puzzle CAPTCHAs without an alternative.

8. Small targets, hidden focus and time limits

Checkbox and link targets should be at least 24 by 24 CSS pixels or spaced apart (WCAG 2.5.8). A sticky order summary or cookie banner must not completely cover the field that has focus (WCAG 2.4.11). If the session or a reserved basket times out, warn the customer and let them extend it (WCAG 2.2.1).

Test the whole checkout by hand

Once a month, place a test order using only the keyboard, then again with a screen reader (VoiceOver on Mac or iPhone, NVDA on Windows, both free). Deliberately make mistakes in the form to see how errors are announced. Hosted checkouts (Shopify, payment pages from Stripe, Mollie, PayPal) are mostly outside your control, but the steps before them, and your branding choices in them, are not.

Our free check walks your shop up to the checkout and shows what to fix.

Check my shop free

Sources

This guide is general information, not legal advice. An automated scan finds many problems but not all of them, so it can't on its own show that a shop meets the law.

More guides