ARIA-Required

ARIA Required (aria-required) indicates if a form field is required. The traditional method has been to add a “*” to the end of the fields’ LABEL text, and this is still recommended until all browsers and AT support the aria-required property.

aria-required uses “true” and “false” to indicate the property. “True” makes the field required, and “false” is not required.

Example 1:

Setting aria-required to true:



Code


<form action="submit.php">
<label for="firstname">First Name*</label>
<input type="text"
	id="firstname"
	name="firstname"
	size="50"
	aria-required="true">
 </form>

Example 2:

Setting aria-required to false has no effect on the screen reader:



Code


<form action="#">
<label for="title">Title</label>
<input 
  type="text" 
  id="title" 
  name="title" 
  size="50" 
  aria-required="false">
<label for="firstname">First Name*</label>
<input 
  type="text" 
  id="firstname" 
  name="firstname" 
  size="50" 
  aria-required="true">
 </p>
 </form>

Works With

Using ARIA REQUIRED
Browser Screen Reader Results
IE 9 JAWS 12 Yes
FF 4 JAWS 12 Yes

Standards:

Comments are closed.