Ensuring Valid Autocomplete Attributes in Form Fields
Rule ID: autocomplete-valid
Ruleset: axe-core 4.10
User Impact: Serious
Guidelines: WCAG 2.1 (AA), WCAG 2.2 (AA), EN 301 549
How to Fix the Problem
To ensure compliance and accessibility, follow these steps for all form fields that collect personal data:
-
Identify Relevant Fields
Look through your form to identify any input fields collecting personal information — such as name, email address, phone number, street address, credit card info, and more. -
Reference the WCAG Input Purposes List
Refer to the official WCAG 2.1 Section 7: Input Purposes for User Interface Components. It outlines 53 recognized input purposes (e.g.,name
,email
,postal-code
,cc-number
, etc.). -
Apply the
autocomplete
Attribute Correctly
Each relevant<input>
or<select>
element should include a validautocomplete
attribute that matches the intended input purpose.
Example: -
Use Only Valid Values
Ensure that the autocomplete attribute values are exact matches from the WCAG list. Invalid or unsupported values will not help screen readers or browsers autofill the data. -
Test for Compatibility
Verify with assistive technology tools and browsers that the form behaves as expected — both for accessibility and autofill convenience.
Why it Matters
Proper use of the autocomplete
attribute ensures a better experience for users with disabilities:
-
Screen Readers: When autocomplete values are missing or incorrect, screen readers fail to convey the intended use of each field, making navigation and form completion frustrating or even impossible.
-
User Experience: Accurate autocomplete values allow browsers to autofill personal data, reducing input time and the likelihood of user error.
-
Compliance: This rule supports WCAG 2.1 Level AA success criterion 1.3.5, which is critical for legal compliance in many regions.
Neglecting these attributes undermines both usability and accessibility, and increases the risk of failing accessibility audits.
Rule Description
This rule ensures that input fields collecting personal information define their purpose programmatically. Valid autocomplete
values from the recognized WCAG list are required so that assistive technologies can accurately identify and communicate the field’s intent to users.
The Algorithm (in simple terms)
To pass this rule:
-
Check each input field that collects personal data.
-
If the field matches one of the 53 types in WCAG’s list:
-
Confirm that it includes the correct
autocomplete
attribute with a valid value.
-
-
Ensure the technology used (HTML5, for example) supports this attribute.
If these conditions are met, the field is accessible and compliant.