Skip to main content
Version: v6

We detected a form field that is required but lacking a required attribute

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

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>