<input> with required and aria-invalid="false"

Return to main list

This is a test case designed to determine how the required attribute, applied to the <input> element, is announced by various screen readers. The aria-invalid has also been used. See note below on why this is not recommended.

Note on required usage

If the required attribute is applied, the invalid state is also set in accessibility APIs. So, form controls with required applied are announced as "Invalid entry" or "Invalid data", even before users have interacted with the control. More details on the issue.

Even though native HTML attributes should be used where possible, authors could choose to use aria-required="true" instead. However, authors should not use aria-invalid="false" to solve this issue.

However, if the user has not attempted to submit the form, authors SHOULD NOT set the aria-invalid attribute on required widgets simply because the user has not yet entered data.

Source.

Example

Code

<div>
  <label for="name">Full name</label>
  <input required type="text" id="name" aria-invalid="false">
</div>

Assistive technologies

VoiceOver

NVDA

JAWS

Return to main list