A11yvanto.online Request an Accessibility Audit

Guide

Accessible Forms and Error Messages

A practical guide for anyone building or editing forms: visible labels, instructions people see in time, and error messages they can act on.

By Benjamin Reed. Updated 3 November 2026. About 6 minutes to read.

Short answer: An accessible form gives every field a visible label linked to it in the code, explains rules before people type, groups related options, identifies errors in text next to each field and in a summary, keeps what people typed, and avoids puzzles and time limits that block disabled users. WCAG 2.2 adds rules against asking for the same information twice and against logins that depend on memory alone.

Start with labels

Every field needs a label that people can see and that software can read. WCAG's Info and Relationships criterion asks that structure and relationships conveyed through presentation can be programmatically determined; a label sitting visually next to a field is not enough if the code does not connect them.[1] In HTML that connection is simple: a label element with a for attribute matching the field's id, or the field placed inside the label.

Placeholder text is not a label. It disappears when people start typing, it is often low contrast, and some assistive technology does not announce it reliably. Use placeholders, if at all, for examples, and keep the label visible above the field.

Labels should describe the information wanted, not the format: "Email address" rather than "Enter text". Put format rules in a separate hint underneath, connected to the field with aria-describedby so screen readers announce it with the label.

Group related controls

Radio buttons and checkboxes that answer one question belong together. Wrap them in a fieldset with a legend that asks the question, such as "How would you like us to contact you?". Without the legend, a screen reader user hears "Email, radio button" with no idea what the choice is about.

The same applies to grouped text fields, such as a date split into day, month and year. The group needs a legend, and each part needs its own label.

Give instructions before, not after

WCAG's Labels or Instructions criterion asks that labels or instructions are provided when content requires user input.[1] Good instructions appear before the point where people need them. If a reference number has a set format, show an example under the label. If a field is required, say so in text, not only with an asterisk or colour. A short line at the top of the form, such as "All fields are required unless marked optional", is clear and easy to follow.

Handle errors well

Error Identification means that when the site detects a mistake automatically, it must point to the field concerned and explain the problem in words.[1] A red border alone fails this, because colour is not text and is not announced. A widely used pattern has three parts:

  1. An error summary at the top of the form after submission, with a heading such as "There is a problem" and a list of errors. Move keyboard focus to the summary so screen reader users hear it straight away.
  2. Links in the summary to each field with an error, so people can jump straight to it.
  3. A message next to each field, connected to it with aria-describedby, repeating the error in specific words: "Enter your phone number in the correct format, like 087 123 4567" rather than "Invalid input".

Keep what people typed. Clearing a form after an error forces people to start again, which is frustrating for everyone and exhausting for people who type slowly or with assistive technology.

One technical detail trips up many sites: a field should have one aria-describedby attribute that lists both the hint and the error ids, separated by a space. Adding a second attribute does not work, because browsers keep only the first.

What WCAG 2.2 adds

Two of the criteria added in WCAG 2.2 apply directly to forms.[2]

  • 3.3.7 Redundant Entry (Level A). In a multi-step process, information the person has already entered should be filled in automatically or available to select, rather than typed again, unless re-entering it is essential.
  • 3.3.8 Accessible Authentication (Minimum) (Level AA). Signing in must not depend only on memory or puzzle tasks, such as recalling a password or transcribing characters. An alternative or some help must be available, such as letting password managers fill the field and allowing paste.

Target Size (Minimum) and Focus Not Obscured also matter for forms: small checkboxes and fields hidden behind sticky banners cause real problems.

Be careful with custom controls

Native HTML controls come with keyboard support and accessible names built in. Custom dropdowns, date pickers, toggles and sliders do not, unless the developer adds them carefully. If you need a custom control, follow an established keyboard pattern, expose its role, name and state, and test it with a keyboard and a screen reader. Often the better answer is a native control styled to match your design.

CAPTCHA and time limits

Image and text puzzles block many disabled people, and audio alternatives are often just as hard. Server-side checks, honeypot fields and rate limiting stop most spam without asking anything of the user. If a session has to time out for security, warn people before it does and let them extend it.

How to test a form in ten minutes

  1. Fill the whole form using only the keyboard. Can you reach and use every field and button, in a sensible order, with focus always visible?
  2. Submit it empty. Do errors appear in text, is there a summary, and does focus move to it?
  3. Turn on a screen reader, such as NVDA or VoiceOver, and move through the fields. Does each one announce a clear label and any hint?
  4. Zoom the page to 200 per cent. Do labels and fields still line up, with nothing cut off?

The form on our contact page is built to these rules, so you can compare.

Writing error messages people can act on

An error message should say what went wrong and how to fix it, in the same words people would use themselves. Compare these:

Weak and stronger error messages
FieldWeak messageStronger message
Email addressInvalid inputEnter an email address in the correct format, like name@example.ie
Date of birthError in dateDate of birth must include a day, month and year
EircodeField requiredEnter your Eircode, for example A65 F4E2
TermsYou must agreeConfirm that you have read the terms to continue

Keep the tone neutral. Avoid words like "illegal", "forbidden" or "failed", and avoid blaming people. Use the field's label in the message so it makes sense when read on its own in the error summary.

Confirm success clearly too

After a successful submission, show a clear confirmation and move focus to it, or to a heading on the confirmation page. Say what happens next and when, such as "We will reply by email". People using screen readers otherwise may not know whether anything happened.

Long and multi-step forms

Forms split across several screens bring extra problems. People need to know how many steps there are and which one they are on, so show progress in text, such as "Step 2 of 4: Your address", not only as a coloured bar. Put the step name in the page title too, so screen reader users hear it when each new step loads.

Let people go back without losing what they entered. If the form times out, warn them before it happens and offer a way to continue, as WCAG 2.2.1 Timing Adjustable asks.[1] Where a later step needs information given earlier, such as a delivery address that matches the billing address, offer it again or let people confirm it with one control instead of retyping it.

Before the final submit, show a summary page with links back to each step. It gives everyone a chance to catch mistakes, and for forms with legal or financial consequences it is one way to meet 3.3.4 Error Prevention (Legal, Financial, Data), which accepts a step where people check and confirm their answers.

Questions about forms

Should we mark required or optional fields?

Mark whichever is less common. If most fields are required, say so at the top and mark the optional ones, in text.

Is inline validation as people type a good idea?

Checking each keystroke is often noisy for screen reader users. Checking when people leave a field or submit the form is easier to follow.

Can we use placeholder text instead of labels to save space?

No. Placeholders disappear as people type and are not reliable labels. Keep a visible label for every field.

Sources

Sources checked on 3 November 2026.

  1. Standard. Web Content Accessibility Guidelines (WCAG) 2.2, W3C, W3C Recommendation, 12 December 2024 edition.
  2. Standard. What's New in WCAG 2.2, W3C Web Accessibility Initiative, checked 3 November 2026.