Edit Text Name

Link to Edit Text Name copied to clipboard

WCAG 2.0 - 1.3.1 A Impact - Moderate

EditText elements must have a name and value available to TalkBack.

Supported within:
XML Layouts

Impact

Issues found by this rule impact people with blindness.

EditText elements should provide information where the Android OS expects. As a result, assistive technologies can communicate information predictably.

Confirmation

  1. Turn on TalkBack
  2. Focus on the element
  3. One of the following will happen:
    • Accessible: TalkBack announces the entered text, for, and the associated labels Text.
    • Inaccessible: TalkBack either didn't read the above information, or it was announced in the wrong order.

How to Fix

EditText editText = .......; // Role: EditText
TextView label = .......; // Role: Label
label.setLabelFor(editText.getId()); // Associate the Checkbox with its Name