Accessible Forms and Error Messages: Best Practices
Imagine entering your details on a long form, selecting Submit, and hearing nothing from your screen reader. The page hasn’t changed, and the Submit button still has focus. Somewhere above it, a date field has turned red. Did the request go through? Should you submit it again?
Accessible forms answer three questions at the point someone needs the information: What should I enter? What needs my attention? Did my submission succeed? The best way to review a form is to follow one entry all the way through a mistake, a correction, and confirmation. Here’s what to look for at each step.
Give each field a label that stays visible

A label names the information you want; a hint explains anything unusual about providing it. For a date field, “Appointment date” is the label and “Use day/month/year, for example 24/09/2026” is the hint. Someone checking their entry should still be able to see both. Placeholder text alone disappears just when the person may want to compare what they typed with the example.
Connect each visible label to its control. In HTML, one reliable approach is to match the label’s for attribute to the input’s unique id. This lets a screen reader identify the field and lets someone select the label to focus the input. Keep the visible wording in the control’s accessible name so a person using voice input can refer to what they see.
- Make required fields explicit. Use a visible convention, explain it before the fields, and expose the required state programmatically. Don’t rely on a red asterisk alone.
- Group related choices. For radio buttons, use a
fieldsetwith alegendfor the question. “Yes” makes sense only if the user knows which question it answers. - State constraints before entry. Put accepted file types, date formats, or password rules beside the relevant control. Associate essential hints with the field, for example with
aria-describedby.
Write error messages that tell people what to do next
Write for someone returning to the field, not for the system that rejected the value. Name the field or refer to its label, describe the problem in plain language, and give a correction when you know one. Be specific about what you actually checked: an email address that lacks an @ sign has a format problem; you don’t know that the address doesn’t exist.
| Situation | Instead of | Try |
|---|---|---|
| Required email field is empty | Required | Enter your email address. |
| Email address lacks an @ sign | Invalid value | Include an @ sign in your email address, for example [email protected]. |
| End date is too early | Date error | Choose an end date on or after the start date. |
| Upload accepts only PDFs | File rejected | Upload your document as a PDF. |
Don’t treat a service failure as a user mistake. If the service cannot confirm receipt, don’t mark a valid field as invalid or claim the submission failed. Explain what is known and give a safe next step. For a payment, that might mean directing the person to check the transaction status rather than asking them to pay again.
Make validation noticeable without interrupting entry

A date such as “24/09/2026” passes through several incomplete states while someone types it. Announcing “Invalid date” after the first digit adds noise, not guidance. For many forms, validating on submission is a sensible starting point. If an earlier check is genuinely useful, wait until the person has had a reasonable chance to finish the field. Avoid flagging untouched fields as errors on page load.
Place the error beside the field and explain it in text. Color and icons can reinforce the message, but should not carry it alone. For a custom validation flow, set aria-invalid to true when the field fails and associate the error text with the control. If you use aria-describedby, it can reference both the hint and the error by ID; adding the error shouldn’t disconnect a format instruction the user still needs.
Once the value passes the check, clear the invalid state and remove the obsolete error association. Test this transition as carefully as the failure: a screen reader announcing yesterday’s problem after today’s correction leaves the user with no trustworthy signal.
Guide keyboard focus through a failed submission
For a short form with one error, moving focus to the invalid field can be enough if its label and error are available together. For a longer form with several errors, put an error summary near the start and move focus to it after the unsuccessful submission. A heading such as “There are two fields to correct” explains why focus has moved. Make each summary item a link to the corresponding control, using the same field name as its label.
For example, selecting “End date: choose a date on or after the start date” should put keyboard focus on End date, not merely scroll that part of the page into view. The user should be able to type the correction immediately. If the field is inside a collapsed section, open the section before focusing it. Keep other valid entries intact so correcting one date doesn’t mean re-entering contact details.
Choose a notification strategy deliberately. Moving focus to a summary and simultaneously announcing the same text through a live region can cause duplicate speech. Listen to the actual result. On success, provide a clear confirmation, and if it appears without navigation or a focus change, make that status available to assistive technology as well.
Test the recovery path, not just the empty form

Use a realistic task, such as requesting an appointment. Enter a valid name, leave the email blank, and choose an end date before the start date. Then submit. This gives the team a repeatable test with two different errors and a valid value that should survive the correction.
- Use only the keyboard. Follow the focus indicator from the first field to Submit. After submission, find both errors, follow the summary links if present, and correct the entries without using a pointer.
- Repeat with a screen reader. Listen for each field’s name, required state, and relevant instructions. Check that a failed submission is apparent and that returning to a field reveals its specific error.
- Check zoom and narrow layouts. Read the hint and error together. Verify that wrapped messages remain visible and that sticky headers or footers don’t cover the focused control.
- Finish the task. Confirm that the valid name remains, old errors disappear, and the success message makes it clear that no further submission is needed.
For a WCAG 2.2 review, record evidence against the relevant criteria, including Labels or Instructions (3.3.2), Error Identification (3.3.1), and Error Suggestion (3.3.3). A useful test note captures the field, trigger, expected behavior, observed behavior, and browser or assistive technology used. Passing a label check alone does not establish that the full form conforms.
Keep accessible forms working after release
Save the recovery test alongside the shared form component, then rerun it on the live journey when field rules, translations, or submission behavior change. A component can have a correctly linked label while the page that uses it still loses focus after a server response. Assign ownership for both: the component team can fix the reusable pattern, while the team responsible for the form verifies the completed journey.
Corpowid’s AI accessibility auditing and continuous monitoring can help teams identify and track detectable issues across websites and apps. Pair those findings with manual keyboard and screen reader testing for questions a scan alone can’t settle, such as whether a spoken correction makes sense in context. When evaluating Corpowid, start with a form your visitors depend on: compare the audit findings with your recovery test and use both to decide what to fix first.