Skip to main content
Version: v6

We detected a checkbox that is required but lacking a required attribute

We detected a checkbox that is required but lacking a required attribute — rule summary
FieldValue
Rule codeManual_Checkbox_Required_Missing
WCAG conformance levelA
WCAG success criterion4.1.2 Name, Role, Value
Must be fixed at sourceNo

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>