WCAG 2.1 Success Criterion 1.3.5 Identify input purpose is one of the success criterion that is easy to implement but difficult to understand. The success criterion expects content authors to implement a mechanism that the browser can remember user’s personal information that is entered while filling a form. Such remembered information can be automatically filled in the next time the user is updating the same information on different website.
While the intention of the success criterion is to make the input of information easy for the user, users may only want the browsers or websites remember if it is their personal computer. Of course none of us want to share our personal information such as phone number and email address publically.
How to implement 1.3.5 Identify input purpose
The sufficient technique H98: Using HTML 5.2 autocomplete attributes advices the use of the autocomplete attribute. Use this attribute
- The input field serves a purpose identified in the Input Purposes for user interface components section; and
- The content is implemented using technologies with support for identifying the expected meaning for form input data.
Automation tools may not show an error if the autocomplete attribute is not at all provided in the form. They can potentially show error if autocomplete attribute is added to the form control but the token value is not one among the defined values.
Autocomplete values for identifying input purpose
|Form purpose||Autocomplete token|
|Prefix or Title such as Mr, Ms, Dr||honorific-prefix|
|New password (While creating account)||New-password|
|Password (While logging in)||Current-password|
|Street address (in case one field collecting entire address)||Streed-address|
|Street Address line 1 (one line per field)||Address-line1|
|Street Address line 2 (one line per field)||Address-line2|
|Street Address line 3 (one line per field)||Address-line3|
|State (Most broad level of address)||Address-level1|
|City / town / district (2nd level of address)||Address-level2|
|Locality (part of address 3rd level)||Address-level3|
|Full name as given in payment instrument||cc-name|
|Number of the payment instrument such as credit card||cc-number|
|Expiry date as on the payment instrument||cc-exp|
|Expiry month if expiry have two fields||cc-exp-month|
|Expiry year if expiry has 2 fields||cc-exp-year|
|Card security code, Card verification code, Card verification value etc||cc-csc|
|Birth day (date)||Birth-day-date|
|Birth day (Month)||Birth-day-month|
|Birth day (Year)||Birth-day-year|
|Complete telephone number including country code||Tel|