Success Criterion 1.3.5 - Level AA
Identify Input Purpose
Ensure it is clear what information is expected from users inside input fields. Set the correct input type to allow auto-completion, e.g. for e-mail addresses. This is faster for everyone and prevents errors for users of assistive technology.
Impact
Give clear instructions and ensure that fields can be filled in automatically by assistive technologies.
Clear instructions are very important for people with cognitive disabilities.
For people with a motor disability, filling in forms automatically is a lot easier.
Clear instructions and auto-completion makes it easier for everyone to fill in information.
Check
“Is the purpose of the input field made clear?“
This can be tested visually, no assistive technologies are needed.
Solution
Set content type
On Android, you can set a content type by using the android:optimizeForAutoFill
property.
The following values are defined:
creditCardExpirationDate
: auto-fillcredit card expiration datecreditCardExpirationDay
: credit card expiration daycreditCardExpirationMonth
: credit card expiration monthcreditCardExpirationYear
: credit card expiration yearcreditCardNumber
: credit card numbercreditCardSecurityCode
: credit card security codeemailAddress
: email addressname
: namepassword
: passwordphone
: phone numberpostalAddress
: postal addresspostalCode
: postal codeusername
: username
Example of using autofillHints
:
Set keyboard type
On Android, you can set a keyboard type by using the android:inputType
property. You can combine values with each other.
The following constants are defined:
date
: for entering a datedatetime
: for entering a date and timenone
: to disable inputnumber
: for entering a numbernumberDecimal
: for entering decimal numbersnumberPassword
: for entering a numeric passwordnumberSigned
: for entering a positive or negative numberphone
: for entering a telephone numbertext
: for entering normal texttextAutoComplete
: to enable automatic completiontextAutoCorrect
: to enable automatic correctiontextCapCharacters
: to automatically convert characters to uppercasetextCapSentences
: to automatically capitalize sentencestextCapWords
: to automatically capitalize wordstextEmailAddress
: for entering an email addresstextEmailSubject
: for entering the subject of an emailtextFilter
: for entering text to filter withtextImeMultiLine
: to force entering multiple lines of texttextLongMessage
: for entering a long messagetextMultiLine
: for entering multiple lines of texttextNoSuggestions
: to disable suggestionstextPassword
: for entering a passwordtextPersonName
: for entering a nametextPhonetic
: for entering phonetic texttextPostalAddress
: for entering a postal addresstextShortMessage
: for entering a short messagetextUri
: for entering a URLtextVisiblePassword
: for entering a visible passwordtextWebEditText
: for entering text in a web formtextWebEmailAddress
: for entering an email address in a web formtextWebPassword
: for entering a password in a web formtime
: for entering a time
Example of using inputType
: