Success Criterion 3.3.1 - Level A
Ensure a clear error message is shown when data has been entered incorrectly. It often happens that data is entered incorrectly. Clearly indicate which input is incorrect and explain why. It is important that error messages are also clear for user of assistive technologies. Ensure errors are also indicated in text to allow everyone to perceive them.
Filling in data correctly becomes easier for everyone when error messages are clearly indicated.
Clear error messages are especially important for people with cognitive, language and learning disabilities.
"Are input errors indicated clearly when entering incorrect data?
This can be tested without assistive technologies.
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")
val type = AccessibilityEventCompat.TYPE_ANNOUNCEMENT val event = AccessibilityEvent.obtain(type) event.text.add("Appt announcement") event.className = Context::class.java.name event.packageName = packageName val accessibilityManager = ContextCompat.getSystemService(this, AccessibilityManager::class.java) accessibilityManager?.sendAccessibilityEvent(event)
On Android, a live region can be set by using the convience method
ViewCompat. To interrupt ingoing speech, also known as being assertive, use
ACCESSIBILITY_LIVE_REGION_ASSERTIVE. To wait for ongoing speech, also known as being polite, use
// Interrupt ongoing speech ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_ASSERTIVE) // Wait for ongoing speech ViewCompat.setAccessibilityLiveRegion(view, ViewCompat.ACCESSIBILITY_LIVE_REGION_POLITE)