We detected a checkbox that is required but lacking a required attribute
| Field | Value |
|---|---|
| Rule code | Manual_Checkbox_Required_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 4.1.2 Name, Role, Value |
| Must be fixed at source | No |
Description
When a checkbox 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 checkbox is mandatory for form submission, add the required attribute to communicate this to all users and enable built-in form validation:
<input type="checkbox" id="terms" required>
<label for="terms">I agree to the terms and conditions*</label>
You can also use aria-required="true" as an alternative or additional attribute:
<input type="checkbox" id="terms" required aria-required="true">
<label for="terms">I agree to the terms and conditions*</label>