Main content

aria-required

Characteristics

Type:

  • String

Related Concepts:

  • HTML 5 required

Used in Roles:

  • combobox
  • gridcell
  • listbox
  • radiogroup
  • spinbutton
  • textbox
  • tree

Inherits into Roles:

  • columnheader
  • rowheader
  • treegrid

Value:

  • true/false
    • true: The element requires user input.
    • false (default): The element may be left blank.

Indicates that user input is required on the element before a form may be submitted.

The aria-required property indicates which input fields of a form must be filled in before it can be submitted. If the user attempts to submit the form without the required information, you may set aria-invalid to indicate the error.

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.

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.

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.

Note  For cross-browser compatibility, always use the aria attribute syntax to access and modify aria properties, for example object.setAttribute("aria-valuenow", newValue).

Syntax

HTML
<element aria-required="p" ... >
JavaScript
object.setAttribute("aria-required",value);var value = object.getAttribute("aria-required");

Microsoft Active Accessibility Properties:

  • N/A

UI Automation Properties: 

  • IsRequiredForForm

UI Automation AriaProperties Property:

  • required
More in this category: « aria-relevant aria-setsize »