Accessibility

How to make a form accessible

Give every field a real label element, mark required fields in text rather than colour alone, associate errors with their inputs programmatically, and make the whole form completable by keyboard. Placeholders are not labels.

Written by Anas Bin Masud 8 steps About 2 hours 262 words

Before you start

  • Access to the form markup
  • A screen reader for testing

The steps

  1. Step 1: Add a label to every field

    A label element with a for attribute matching the input id. Visible, not hidden.

  2. Step 2: Remove placeholder-only labels

    The placeholder vanishes on typing, so the user loses the label exactly when they need it.

  3. Step 3: Group related fields

    fieldset and legend for radio groups and checkbox sets.

  4. Step 4: Set autocomplete attributes

    name, email, tel, street-address. It reduces effort for everyone and is a WCAG 2.2 requirement.

  5. Step 5: Mark required fields in text

    required plus aria-required, and the word "required" — not only a red asterisk.

  6. Step 6: Associate error messages

    aria-describedby pointing at the message, and aria-invalid on the field.

  7. Step 7: Announce errors

    A live region, or move focus to the first error, so a screen reader user knows something failed.

  8. Step 8: Test by keyboard alone

    Complete the entire form without a mouse, including submission and error recovery.

Label in Name

If a button reads "Send message" visually, its accessible name must contain that text. A voice-control user saying "click send message" needs the words to match — an aria-label of "Submit" on a button reading "Send message" breaks that outright.

Why this matters commercially

An inaccessible form does not lose you an abstract percentage of users; it loses you the specific enquiry from the person who could not complete it. Forms are where accessibility failures cost money most directly.

The background behind this

Website accessibility, without the compliance theatre covers the reasoning in about 5 minutes — free, ungated, written from client work.

Who wrote this

Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada, Ireland and Pakistan. These procedures are the ones I run on client work, written down rather than invented — including the ones where the honest answer is that the fix is not available on your current hosting.

Related procedures

All 64 how-to guides →

Want this done rather than done yourself?

Send the brief and you get a reply within one business day — either questions, or a scoping call. If your project is not something I should take on, I will say so then.

Response
Replies within 1 business day
Hours
Mon–Fri, 09:00–18:00 PKT — overlaps 05:00–14:00 UK, 00:00–09:00 US Eastern
Booking
Booking projects from October 2026
WhatsApp — opens a chat with +92 346 5348466 in a new tab