Success Criterion 3.3.3 - Level AA
Error Suggestion
Ensure suggestions are provided when data has been entered incorrectly. Users regularly make mistakes when entering data. Help users to fix these errors by providing suggestions. For example, when a date has been entered incorrectly, indicate in which order the day, month and year are expected.
Impact
Suggestions to correct data which has been entered incorrectly helps everyone.
People with cognitive, language and learning disabilities are most helped with suggestions to solve mistakes.
Check
“Are suggestions provided when data has been entered incorrectly?“
This can be tested without assistive technologies.
Solution
Provide solutions for errors
On Android, you can use a TextView
to show an error message. The error message should also be posted to assistive technologies by using an accessibility announcement
.
You can also use TextInputLayout
, which makes showing error messages easier. Set setErrorEnabled
to true
and then set the error message by using the setError
method.
textView.setVisibility(View.VISIBLE)
textView.text = "Invalid date, must be in the form DD/MM/YYYY, for example, 01/01/2000"
input.setErrorEnabled(true)
input.setError("Invalid date, must be in the form DD/MM/YYYY, for example, 01/01/2000")