We detected a form field that is required but lacking a required attribute
| Field | Value |
|---|---|
| Rule code | Manual_FormField_Required_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 4.1.2 Name, Role, Value |
| Must be fixed at source | No |
Description
When a form field is functionally required for form submission, it must also be programmatically marked as required. This ensures that all users, including those using assistive technologies, can identify which form controls are mandatory and receive appropriate validation feedback.
How to fix
When a form field is mandatory for form submission, add the required attribute to communicate this to all users and enable built-in form validation:
<input id="name" required>
<label for="name">First Name*</label>
You can also use aria-required="true" as an alternative or additional attribute:
<input id="name" required aria-required="true">
<label for="name">First Name*</label>