Entering a name, address, and phone number from scratch takes time. It can also be difficult for people who have trouble remembering information or typing it. When a form identifies the purpose of these fields in its code, browsers can offer saved details and assistive tools can present the fields in more familiar ways.
What does WCAG require?
Identify Input Purpose (1.3.5) is Level AA in WCAG 2.1 and 2.2. It applies when a field collects information about the person using the form, its purpose appears in the WCAG list of input purposes, and the technology supports identifying that purpose in code. The requirement can apply to text fields, text areas, and select menus. A product search or a field for somebody else’s contact details falls outside this criterion.
If a field accepts two purposes, such as a username or email address, and the technology can express only one, W3C allows authors to identify either purpose or omit the designation for that combined field.
Common form issues
- A contact form uses
type="email"for the visitor’s email address. The type describes the expected format. The field still needs a way to identify its purpose. - A checkout form labels a delivery field “Postal code” but uses an invented token such as
shipping-zip. - The billing postal code has a valid
shipping postal-codetoken copied from the delivery form.
How to identify each field
In HTML, use autocomplete with a standard token, a keyword that tells software which information the field expects. Use given-name for a first name and family-name for a surname. For separate delivery and billing fields, place shipping or billing before the detail token.
<label for="delivery-postcode">Delivery postal code</label>
<input id="delivery-postcode" name="delivery_postcode"
autocomplete="shipping postal-code">
<label for="billing-postcode">Billing postal code</label>
<input id="billing-postcode" name="billing_postcode"
autocomplete="billing postal-code">
Keep the visible labels clear. If you limit autofill for a particular workflow, preserve the field’s programmatically identifiable purpose. A generic value such as off does not identify what the field collects.
How to test input purpose
Automated checks can flag some invalid tokens or invalid token combinations. Manually review which fields are in scope, inspect the rendered attributes, and confirm that each token matches what the field asks the user to provide. Browser autofill with sample data can expose swapped mappings, but browsers can also guess field purposes. Judge conformance from the programmatically exposed purpose.
Use SimplifyAccess Compliance Assessment to record the forms you reviewed and note any missing or mismatched purpose values.
Related accessibility requirements
The guide to accessible form labels and instructions explains what users need to see before entering information. Give each applicable field both a clear prompt and a purpose that software can identify.
