Description
Indicates that user input is required on the element before a form may be submitted.
For example, if the user needs to fill in an address field, the author will need to set the field’s aria-required attribute to true.
Note: The fact that the element is required is often presented visually (such as a sign or symbol after the widget). Using the aria-required attribute allows the author to explicitly convey to assistive technologies that an element is required.
Unless an exactly equivalent native attribute is available, host languages SHOULD allow authors to use the aria-required attribute on host language form elements that require input or selection by the user.
Example
HTML Example
<div class="text">
<label id="tp1-label" for="first">First Name:</label>
<input type="text" id="first" name="first" size="20"
aria-labelledby="tp1-label"
aria-describedby="tp1"
aria-required="false" />
<div id="tp1" class="tooltip"
role="tooltip"
aria-hidden="true">Your first name is optional</div>
</div>
Characteristics
Related Concepts
- HTML required
Used in Roles
- combobox
- gridcell
- listbox
- radiogroup
- spinbutton
- textbox
- tree
Inherits into Roles
- columnheader
- rowheader
- searchbox
- treegrid
Value
- True/False
- Value representing either true or false. The default value for this value type is False, unless otherwise specified.
- False (default)
- User input is not necessary to submit the form.
- True:
- Users need to provide input on an element before a form is submitted.
Semantic HTML
Use the HTML “required” attribute.
<input type=”text” required>
—-
<select required>
<option value="">None</option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
Reference
W3C (opens new window)