By · Updated

AI-generated photograph: high-contrast keyboard, headphones and form wireframe
Forms & accessibility · 11 min

Design a useful and accessible web form

A form asks someone to trust a service and invest effort. A short form can still fail if its questions are unclear, errors erase work or success is never confirmed. Design the content, interaction and recovery path together.

Key points

What to remember.

  • Collect only information needed for the stated task.
  • Give every control a visible, technically associated label.
  • Preserve entered answers and confirm what happened after submission.
01

Define the outcome and remove unnecessary questions

Write one sentence explaining what the person receives after submission: a reply, registration, quote or recorded request. For every field, ask who will use the answer and when. Collect information needed only after an initial conversation later. A privacy notice does not justify collecting more than the task requires. Mark optional and required fields clearly.

02

Put questions in a natural order

Begin with information that is easy to provide, then ask for details needed to respond. Group long forms by topic with meaningful headings and show progress only when real steps exist. On mobile, avoid layouts that force the eye to jump between columns. The reading order, keyboard order and validation order should make sense together.

03

Keep labels visible and specific

Associate a label element with every control. Placeholder examples may help, but they disappear as someone types and cannot replace a label. Put format instructions and limits before submission. Group related choices with fieldset and legend. A required-field marker should be understandable without colour or an unexplained asterisk.

04

Help people enter information

Use an appropriate input type, useful autocomplete and a text area sized for the expected answer. Accept formats you can parse rather than demanding unnecessary punctuation changes. Do not block pasting. On a phone, check that the keyboard does not hide instructions, errors or the submit button. Repeat important validation on the server.

05

Explain errors without deleting work

An effective message identifies the field, describes the problem and states the next action. Show it next to the field and provide a summary linking to each issue when several exist. Preserve valid answers when submission fails. Test blank, long and unusual values, service outages and repeated clicks; never imply success when the server did not receive the request.

06

Confirm the result and next step

After submission, state whether the request was recorded, what happens next and where help is available. Avoid promising a response time the team cannot maintain. If delivery fails, offer a retry or another contact route. A silent session expiry should not force someone to recreate a long response.

07

Test a complete task on different devices

Complete the form by keyboard, with zoom, on a phone and with a screen reader where possible. Check focus, announced labels, grouped controls, error messages and real confirmation. Ask someone unfamiliar with the project to try without guidance; record hesitation and questions, fix recurring blockers and repeat the task.

Sources

Check the reference material.

W3C WAI · Forms tutorial

W3C WAI · Labelling controls

CNIL · Minimise collected data

Try the interaction

An error should lead to its correction.

Leave a field empty or enter an incomplete email, then validate. Follow the error link, correct the field and try again. Use fictional details: this demonstration sends nothing and saves nothing.

Example: test@example.org. No message will be sent.

Observe three things: the summary identifies the affected fields, the nearby message explains what to change, and valid input stays in place. This client-side example does not replace server validation or a full accessibility evaluation.

W3C WAI · User notifications

Worked decision

Test error recovery as well as submission

Fictional teaching example, not a client result or a market benchmark.

A request form asks for a name, email address and message. Acceptance testing with fictional data should cover errors and confirmation, using a keyboard and relevant assistive technology.

On a small screen, scroll horizontally to read every column. You can focus the table area and use the left and right arrow keys.

Four form acceptance-test scenarios
ScenarioExpected resultDefect to fix
Incomplete email addressSpecific error associated with the field; input retainedGeneric unexplained error
Keyboard journeyAll fields and actions reachable in a coherent orderLost focus or unreachable control
Accepted submissionExplicit confirmation of the actual outcomeEmpty form without outcome feedback
Correct and submit againThe error clears, other values remain and the outcome is announcedA local correction causes a silent second submission or an ambiguous confirmation

Distinguish input validation from processing confirmation. If the server rejects a request, the page must not announce success. If email delivery is unverified, confirmation should describe only what was actually accepted.

Associate each error with its field and explain how to correct it. Observe whether the person can locate the field and finish without re-entering everything. These scenarios supplement accessibility evaluation; they do not establish overall conformance.

Reference for the method: W3C WAI · Form notifications.

What to record before deciding

Record browser, interaction method, reproduction steps, message shown and the result of retesting after correction.

Put the method into practice

An illustrative application case

A form displays a general error after submission. Test deliberately incomplete entry: users should understand which field to correct and retain previous values. Check error announcement, focus and final outcome before accepting the journey.

Organise user acceptance testing

Use this worksheet in a review with the person responsible for delivery. Keep the evidence alongside the decision, rather than marking a task complete on trust alone.

Actions and evidence to retain
ActionEvidence
Justify every field and identify required information.A form limited to necessary inputs with persistent labels and helpful examples.
Trigger an error and verify that it can be corrected.Precise feedback, preserved input and an error connected to the affected field.
Test keyboard navigation, zoom and post-submission feedback.Explicit confirmation and a receipt test in the destination system.

A question to resolve before acting

Can a placeholder replace a label?

No. It disappears when typing and may be difficult to read. Keep a visible label connected to the control, then add persistent instructions for any necessary format or constraints.

Continue

Turn the method into a clear project.

Use the directory to explore relevant resources, or describe your context so the right questions can be identified before a conversation begins.

Source note

A visible label and an error message must form one usable journey

The W3C tutorial explains that a control needs a label describing its purpose and associated with it in the code. For an ordinary HTML field, the label’s “for” value must exactly match the field’s “id”; this association also makes the label clickable.

Deliberately test failure next: leave a required field empty or enter a date in an incorrect format. The message should name the field, explain the necessary correction and be discoverable without visually searching the whole page. A format example before input prevents some errors but does not replace understandable feedback after submission.

Do not identify a field solely through placeholder text: it can disappear when typing begins. Keep an explicit label and provide format instructions before people have to guess the expected value. Where choices are similar, explain their differences.

Test an empty submission and an incorrect value. People should be able to find the affected field, understand the problem and correct it without losing their other answers. Also check that clicking the label activates its associated control: this simple test reveals some incorrect label–field associations.

Identification
Keep a visible label for every control.
Help
Explain the expected format before validation.
Correction
Allow the affected answer to be found and edited.

Can placeholder text replace a field label?

No. It may provide an example, but its disappearance during typing removes a useful reference. The label must remain identifiable and correctly associated with the field.

Try the reasoning

A form rejects a date without explaining the expected format. How can the correction be tested?

Reasoning: Enter the rejected case again, then correct it using only the message. Check that the entered value is retained and the affected field is identifiable.

Primary source : W3C WAI — Labeling Controls