Accessible Form Design: WCAG Criteria and Techniques
An accessible form gives every input a visible label that is also its programmatic name (WCAG 1.3.1, 2.4.6, 3.3.2), tags personal fields with autocomplete tokens (1.3.5), groups related choices with fieldset and legend, never asks for the same answer twice in one process (3.3.7) and never makes login depend on memory, transcription or puzzles (3.3.8). Six success criteria carry most of this work. Four are Level A or AA rules on labels, structure and input purpose that have been in WCAG for years. Two, 3.3.7 and 3.3.8, are among the nine criteria added in WCAG 2.2, which became a W3C Recommendation on 5 October 2023. The W3C lists sufficient techniques for each, and the GOV.UK Design System documents matching patterns for labels, hints, dates, radios and passwords.
Criterion-to-technique table
| Criterion | Level | What it requires | Sufficient or key techniques |
|---|---|---|---|
| 1.3.1 Info and Relationships | A | Information, structure and relationships conveyed through presentation can be programmatically determined or are available in text | H44 (label for control), H71 (fieldset/legend), H85 (optgroup), ARIA17 (grouping roles), ARIA16 (aria-labelledby) |
| 2.4.6 Headings and Labels | AA | Headings and labels describe topic or purpose | G130 (descriptive headings), G131 (descriptive labels) |
| 3.3.2 Labels or Instructions | A | Labels or instructions are provided when content requires user input | H44, H71, or G131 combined with one of ARIA1, ARIA9, ARIA17, G89, G184, G162, G83, H90 |
| 1.3.5 Identify Input Purpose | AA | The purpose of each field collecting information about the user can be programmatically determined | H98 (HTML autocomplete attributes) |
| 3.3.7 Redundant Entry | A | Information already entered in the same process is auto-populated or selectable | G221 (provide data from a previous step) |
| 3.3.8 Accessible Authentication (Minimum) | AA | No cognitive function test in any authentication step, unless an alternative, mechanism, object recognition or personal content exception applies | G218 (email link), H100 (properly marked-up email and password inputs) |
| 2.5.3 Label in Name | A | The accessible name contains the visible label text | G208, G211 |
For a wider view of the 2.2 changes, see WCAG 2.2 explained. Level AAA 3.3.9 Accessible Authentication (Enhanced) is stricter than 3.3.8 and is not required by the usual AA targets.
Labels: one visible name, programmatically attached
Success criterion 3.3.2 says, in full, “Labels or instructions are provided when content requires user input.” The Understanding document says “requires” is used as a synonym for “accepts”, “expects” or “allows”, so the rule covers optional fields as well as required ones. The standard HTML technique, sufficient for both 3.3.2 and 1.3.1, is H44: a label element whose for attribute matches the control’s id.
<label for="contact-email">Email address</label>
<p id="contact-email-hint">We will send the booking confirmation here</p>
<input id="contact-email" name="email" type="email"
autocomplete="email" aria-describedby="contact-email-hint">
Three details matter in practice.
- The label is also the name. 2.4.6 asks that labels describe purpose, and the W3C notes a label can be very short if it cues the user. 2.5.3 Label in Name adds that the accessible name must contain the visible text, so speech-input users can say what they see. The related failure F111 is a control with visible label text but no accessible name.
- A placeholder is not a label. The W3C forms tutorial says placeholder text disappears as the user types, often renders below contrast requirements and is not treated as a label by screen readers, though its own examples still pair a visible label with a placeholder example. The GOV.UK text input page goes further and says not to use placeholder text for hints or examples either, partly because not all screen readers read it out.
- Position the label predictably. GOV.UK puts labels above the input, keeps them short, uses sentence case and omits trailing colons. Technique G162 (label positioning) exists so the relationship between label and control is predictable to sighted users, and H44 supplies it to everyone else.
When a label cannot be written without a long sentence, give the control a short label and put the rest in a hint. GOV.UK’s rule for hints is one short sentence without a full stop and without links, because screen readers read the whole hint aloud and usually do not tell users that linked text is a link. Connect the hint with aria-describedby, which makes it the field’s description rather than part of its name; the W3C tutorial notes that this text is announced after the label and other information. The screen reader compatibility guide covers how names and descriptions are computed.
Instructions: format, required fields and ordering
Technique G89 (expected data format and example) and G184 (text instructions at the start of a form or field set) both satisfy 3.3.2 when paired with a descriptive label. The Understanding document gives a date pattern such as dd/mm/yyyy and limits on username characters as the kinds of rule that need stating, and notes long instructions can appear only on focus or behind a link or button.
Marking required and optional fields
The W3C forms tutorial recommends an overall instruction saying how required and optional fields are marked, placed before the form element so screen readers announce it before entering forms mode. Technique H90 marks required controls in the label or legend. GOV.UK takes the opposite default to many sites: in most contexts it adds “(optional)” to the labels of optional fields, adds it to the legend for radios and checkboxes, and says “Never mark mandatory fields with asterisks.” Both conventions put the field’s status in text; what fails users is an unexplained asterisk or colour alone. The native required attribute exposes the state to assistive technology, and the visible text exposes it to everyone else.
Asking only what is needed
GOV.UK’s question-page pattern tells teams to know why they ask each question and to ask only for what they really need, to say why it is being asked and to allow “I do not know” where that is a valid answer. It also recommends one question per page and “Continue” rather than “Next” on the button. A field you remove cannot be mislabelled, mis-announced or mistyped.
Numbers and identifiers
GOV.UK advises against <input type="number"> unless user research shows a need, and recommends inputmode="numeric" for whole numbers and inputmode="decimal" for decimals, omitting inputmode when negative values are possible because some keypads cannot type a minus sign. It also recommends spellcheck="false" for reference numbers, names, email addresses and National Insurance numbers. Use a text input with an input mode for identifiers such as account numbers so leading zeros survive.
Grouping: fieldset, legend and the page heading
A set of radio buttons or checkboxes answers one question, and the question must be announced with each option. Technique H71 uses fieldset and legend for this, and 1.3.1 lists it as sufficient.
<fieldset>
<legend>How should we contact you?</legend>
<label><input type="radio" name="contact-method" value="email"> Email</label>
<label><input type="radio" name="contact-method" value="phone"> Phone</label>
</fieldset>
GOV.UK’s radios, question pages and date input guidance adds four rules:
- If the page asks a single question, the
legend(or thelabel, for a single input) can be the page heading, so screen reader users hear it once. If the page asks several questions, do not make the legend the heading. - Do not pre-select a radio option. GOV.UK says pre-selection makes users more likely to miss a question or submit the wrong answer, and that a radio selection cannot be cleared without refreshing, so include “None of the above” or “I do not know” when valid.
- Use conditional reveal only for a simple related question. GOV.UK documents a known issue: users are not always told a revealed question appeared or disappeared, which it says fails WCAG 2.2 4.1.2. In its research, screen reader users had no difficulty answering a simple revealed question, but users were confused when complicated questions were revealed, particularly ones with more than one part. Anything complicated belongs on the next page.
- Never move focus automatically between the fields of a composite control such as a date. GOV.UK’s date input uses three separate fields in a
fieldset, each withinputmode="numeric". For a date of birth it setsautocompletetobday-day,bday-monthandbday-year, and it tells services to accept month names such as “jan”.
Input purpose: autocomplete tokens (1.3.5)
SC 1.3.5 applies to “each input field collecting information about the user” whose purpose is in WCAG’s list of input purposes. That list has 53 entries in the WCAG 2.2 text, from name, given-name and family-name through street-address, postal-code, cc-number, bday, tel and email to impp, and each corresponds to an autofill token in the HTML standard. The technique is H98: set the attribute. The Understanding document makes two points that trip up teams:
typeis not enough.type="email"is too broad to identify purpose, so the field also needsautocomplete="email"(or another token) where it holds the user’s own details.- Scope is the user’s own data. A purpose such as
transaction-amountis on the list but is not about the user, so those inputs need not expose it. A field asking for someone else’s email address is not covered by the user’semailtoken; leave it off rather than mislabel it.
GOV.UK adds that prototypes do not usually need the attribute because users are rarely on their own devices, but production services need it to meet 1.3.5. Judge the markup rather than the autofill result: the Understanding document says whether a browser actually autofills is not relevant to this criterion, and that a browser filling fields by heuristics does not meet it. Failure F107 covers incorrect autocomplete values.
Redundant entry (3.3.7)
Information “previously entered by or provided to the user that is required to be entered again in the same process” must be auto-populated or available for selection. Three exceptions apply: re-entry is essential, it is required to ensure the security of the content, or the earlier information is no longer valid. The Understanding document puts the responsibility on the site rather than the browser’s autofill, and says the criterion does not require storing information between sessions. Its examples are practical:
- a “billing address same as delivery address” option;
- keeping a submitted card number in the field after a card-number error rather than clearing it;
- showing an earlier value again, preselected and editable, later in the purchase;
- prefilling a search term from earlier in the same process.
The security exception covers confirming a newly created hidden password, because the author cannot validate it. The sufficient technique is G221, provide data from a previous step. GOV.UK’s question-pages pattern says the same in plainer words: ask for a piece of information only once in a journey, and pre-populate fields or show carried-forward responses for the user to select. For the correction side of a multi-step form, see accessible form errors.
Accessible authentication (3.3.8)
SC 3.3.8 says a cognitive function test, “such as remembering a password or solving a puzzle”, is not required for any step of an authentication process unless that step offers at least one of four exceptions:
| Exception | Meaning |
|---|---|
| Alternative | Another method that does not rely on a cognitive function test |
| Mechanism | A mechanism that helps complete the test, such as password-manager support or copy and paste |
| Object recognition | The test asks the user to recognise objects |
| Personal content | The test asks the user to identify non-text content the user provided to the site |
Every step must comply, so at least one path through login must avoid unexcepted tests. The Understanding document’s concrete guidance for form builders:
- Use properly marked-up email and password inputs (H100) so password managers can fill them, which also depends on 1.3.5 and 4.1.2.
- Blocking paste or autofill fails the criterion unless another method is offered. Verification codes must be pasteable, split one-digit boxes that reject a pasted code can fail, and asking for only the 1st, 3rd and 5th characters forces transcription. The listed common failure is F109, preventing password or code re-entry in the same format.
- Email-link authentication (G218) is a sufficient technique. A show-password toggle helps users who create passwords they will store in a manager.
GOV.UK’s password pattern arrives at the same place from a security direction: let users paste, require at least 8 characters, set no maximum length, block commonly used passwords and avoid regular forced changes. Its password input component sets autocomplete to new-password when creating a password and current-password otherwise, hides the password by default behind a show button, and says not to use maxlength because pasted text can be silently truncated. SC 3.3.8 covers authenticating existing users, including recovering an account, but not account creation, though the same techniques help there. Level AAA 3.3.9 removes the object-recognition and personal-content exceptions.
Pre-release form audit checklist
Work through every row with the form in each state: empty, filled, in error and after a step back.
| Check | Criterion | Pass condition |
|---|---|---|
| Every input has a visible label | 3.3.2, 2.4.6 | Label text is not a placeholder, and describes purpose |
| Label linked in code | 1.3.1 | for matches id (H44); accessible name contains the visible text (2.5.3) |
| Radio and checkbox sets grouped | 1.3.1 | fieldset and legend carry the question (H71) |
| Hints and formats stated before input | 3.3.2 | Format and example visible; hint tied by aria-describedby |
| Required and optional states marked | 3.3.2 | Stated in text, not only colour or an asterisk without explanation |
Personal fields carry autocomplete | 1.3.5 | Token present and correct for the field’s purpose (F107) |
| No repeated questions in the process | 3.3.7 | Earlier answers prefilled or selectable |
| Login accepts paste and password managers | 3.3.8 | Paste and autofill work; codes pasteable; no puzzle or transcription step without an alternative |
| Conditional fields announced | 4.1.2 | Revealed questions are simple; test with a screen reader |
Run it with the keyboard as well, as set out in the keyboard accessibility guide, because focus order and visible focus are separate criteria not covered by this table.
Sources
- W3C WAI: What’s New in WCAG 2.2
- W3C: Understanding SC 1.3.1 Info and Relationships
- W3C: Understanding SC 2.4.6 Headings and Labels
- W3C: Understanding SC 3.3.2 Labels or Instructions
- W3C: Understanding SC 1.3.5 Identify Input Purpose
- W3C: Understanding SC 3.3.7 Redundant Entry
- W3C: Understanding SC 3.3.8 Accessible Authentication (Minimum)
- W3C: Understanding SC 3.3.9 Accessible Authentication (Enhanced)
- W3C: Understanding SC 2.5.3 Label in Name
- W3C: WCAG 2.2, Input Purposes for User Interface Components
- WHATWG HTML Living Standard: Autofill
- W3C WAI forms tutorial: instructions
- GOV.UK Design System: text input
- GOV.UK Design System: date input
- GOV.UK Design System: radios
- GOV.UK Design System: question pages
- GOV.UK Design System: password input
- GOV.UK Design System: passwords