
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.
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.
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.
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.
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.
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.
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.
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.
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.
Check the reference material.
Related guides
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.
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.
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.
| Scenario | Expected result | Defect to fix |
|---|---|---|
| Incomplete email address | Specific error associated with the field; input retained | Generic unexplained error |
| Keyboard journey | All fields and actions reachable in a coherent order | Lost focus or unreachable control |
| Accepted submission | Explicit confirmation of the actual outcome | Empty form without outcome feedback |
| Correct and submit again | The error clears, other values remain and the outcome is announced | A 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.
| Action | Evidence |
|---|---|
| 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.