--- url: "https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA2" titulek: "ARIA2: Identifying a required field with the aria-required property | WAI | W3C" h1: "Technique ARIA2:Identifying a required field with the aria-required property" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 04:43:05" znaku: 5152 slov: 669 kodovani: "utf-8" sha256: "dcbdabba5246d2c1ba4f770784351b1627b36b07b6c3068d2f481783b76e0f19" --- # Technique ARIA2:Identifying a required field with the aria-required property ## About this Technique This technique relates to: - [1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships) ( **Advisory** ) - [3.3.1 Error Identification](https://www.w3.org/WAI/WCAG22/Understanding/error-identification) ( **Advisory** ) - [3.3.2 Labels or Instructions](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions) ( **Advisory** ) This technique applies to technologies that support [Accessible Rich Internet Applications (WAI-ARIA)](https://www.w3.org/TR/wai-aria/). Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are **not required** to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about). ## Description The objective of this technique is to enhance programmatic indication that a form field (which is shown through presentation to be required) is mandatory for successful submission of a form. The fact that the element is required is often visually presented (via a text or non-text symbol, or text indicating input is required or color / styling) but this may not be programmatically determinable as part of the field's name. The WAI-ARIA `aria-required` property indicates that user input is required before submission. The `aria-required` property can have values of `true` or `false`. For example, if a user must fill in an address field, then `aria-required` is set to `true`. Note This technique is set as advisory for meeting 3.3.2 Labels or Instructions, because use of `aria-required="true"` alone, without any visual indicator, would not be perceivable to most users. However, when an asterisk or other text symbol is associated with the field, using the `aria-required` property in addition to the visual presentation enables user agents to pass on this important information to the user in a user agent-specific manner. Refer to [ARIA in HTML](https://www.w3.org/TR/html-aria/) for information on how to provide WAI-ARIA States and Properties with HTML. WAI-ARIA States and Properties are compatible with other languages as well; refer to documentation in those languages. ## Examples ### Example 1: The `required` property is indicated by an asterisk placed in the `label` element ```
``` ### Example 2: The `required` property is indicated by the word "required" placed next to the `label` element ``` ``` ### Example 3: Required fields are indicated by a red border around the fields and a star icon rendered via CSS using `::after` This example uses custom radio buttons with `role=radio`. The CSS properties are available below the form. ``` ``` Related CSS style definition for this example: ``` [aria-required=true] { border: red thin solid; } [data-required=true]::after { content: url('/iconStar.gif'); } ``` ## Related Resources *No endorsement implied.* - [WAI-ARIA Overview](https://www.w3.org/WAI/standards-guidelines/aria/) . - [WAI-ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/) . - [aria-required=true: WCAG 2 Compliance versus Best Practice](http://www.deque.com/blog/aria-requiredtrue-wcag-2-compliance-practice/) . ## Tests ### Procedure For each control which is shown via presentation to be required. 1. Check whether the `aria-required` attribute is present: 2. Check whether the value of the `aria-required` attribute is the correct required state of the user interface component. ### Expected Results - Checks #1 and #2 are true Back to Top