Fix label axe errors
A form control has no programmatic label, so assistive technology cannot reliably announce what input is expected.
Кого затрагивает
Screen-reader users, speech-input users, and people who depend on persistent visible instructions.
Связь с WCAG
4.1.2 Name, Role, Value (A)
Обнаружение
wcagc reports supported form controls whose computed accessible name is empty, using axe-core's rendered accessibility semantics.
Почему возникает эта ошибка
- Placeholder text is used as the only label.
- A label's for value does not match the control id.
- A custom field component renders its caption visually but does not associate it programmatically.
Проблемная разметка
<input id="email" type="email">Исправленный код
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email">Проверьте исправление вручную
Navigate to the control with a screen reader and speech input. Confirm that the visible label, accessible name and purpose agree and that instructions remain available after typing.
Границы автоматизации
A scanner can confirm that a name exists, but not that it is specific enough, matches the visible label, or explains the expected format and errors.
Источники и стандарты
Метаданные правила и ссылка Deque генерируются из axe-core 4.12.1. Ссылка W3C ведёт на нормативное руководство WCAG для соответствующего критерия.
Вопросы разработчиков
Is placeholder text an accessible label?
No. It disappears as users type and is not a dependable visible or programmatic name. Keep a persistent label.
Can aria-label fix an unlabeled field?
It can provide a programmatic name, but a visible label is usually better for everyone and should be preferred when the design permits it.
Одно нарушение редко встречается в одиночку
Запустите проверку страницы в wcagc, чтобы найти это правило, связанные проблемы WCAG, затронутые селекторы и пункты, требующие ручной оценки.
Проверить страницу