Skip to main content
No Result Found

field-not-required

Rule Severity : Serious

Description

An optional field must not be indicated as required. This ensures that users are not misled into thinking they must provide information when it is not necessary. Properly indicating optional fields helps users understand which inputs are mandatory and which are not, improving the overall user experience and accessibility.

The field-not-required rule aligns with WCAG Success Criterion 3.3.2 (Labels or Instructions), which requires that labels or instructions are provided when content requires user input.

Examples

In the following example, an optional field is incorrectly marked as required using the required attribute. This violates the field-not-required rule because it misleads users into thinking they must provide information when it is not necessary.

Incorrect Sample
Copy icon Copy

In the following corrected example, the required attribute is removed, and the optional nature of the field is clearly indicated in the label:

Correct Sample
Copy icon Copy

How to fix?

To fix violations of the field-not-required rule, follow these steps:

  1. Identify all optional fields on your webpage.
  2. Ensure that optional fields are not marked with the required or aria-required="true" attributes.
  3. If possible, clearly indicate in the label or instructions that the field is optional.

Reference

WCAG Success Criterion 3.3.2: Labels or Instructions

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle