3.3.2 Labels or Instructions
Introduction
This article provides information about the accessibility check:
- Labels or instructions are provided when content requires user input.
What
When a webpage includes input fields such as text boxes, dropdowns, or checkboxes that require user interaction, visible labels or instructions must always be present to describe the purpose of the input. These labels help users understand what information is expected and improve accessibility for assistive technologies.
This check ensures that:
- Every input field has a visible label that does not disappear when users interact with the field.
- The label provides clear and descriptive information about the required input.
- If additional instructions are needed, they are visible and persistently available to the user.
Why
This section provides information about why this check is important and provides some examples.
Why is this important?
- Improves accessibility: Users who rely on assistive technologies, such as screen readers, need properly labeled inputs to understand what to enter.
- Enhances usability: All users can complete forms accurately.
- Prevents confusion and input errors: Users are less likely to enter incorrect information or struggle to complete the form.
Examples
Pass examples
The label is explicitly associated with an input field
<label for="email">Email Address:</label>
<input type="email" id="email" name="email">
- Why this works:
- The label is always visible and clearly describes the expected input.
- The
for attribute correctly associates the label with the input field.
The input field has a persistent placeholder text and instructions
<label for="phone">Phone Number:</label>
<input type="tel" id="phone" name="phone" placeholder="Format: 123-456-7890">
- Why this works:
- The label remains visible at all times.
- The placeholder text provides additional guidance but does not replace the label.
Grouped radio buttons with a fieldset and legend
<fieldset>
<legend>Select your preferred contact method:</legend>
<input type="radio" id="email" name="contact" value="email">
<label for="email">Email</label>
<input type="radio" id="phone" name="contact" value="phone">
<label for="phone">Phone</label>
</fieldset>
- Why this works:
- The legend provides a clear description of the group of inputs.
- Each radio button has an associated visible label.
Fail examples
How
This section provides instructions on how to review and fix the issue.
How to review it
- Check all input fields to ensure that they have a visible label:
- Labels must not disappear when the user starts typing.
- Placeholder text alone is not a sufficient label.
- Ensure that labels describe the expected input clearly:
- Avoid vague labels such as Enter value. Be specific about the required information.
- Test the form with a screen reader:
- Ensure that labels are correctly associated with input fields and announced properly.
How to fix it
Always provide a <label> element for each input field and associate it with the for attribute.
Example:
<label for="fullname">Full Name:</label>
<input type="text" id="fullname" name="fullname">
Use fieldsets and legends for grouped inputs, for example radio buttons or checkboxes.
Example:
<fieldset>
<legend>Choose your gender:</legend>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
</fieldset>
Ensure that instructions are visible at all times and do not rely only on placeholders.
Additional resources
If you cannot find the help article for a specific check that is failing, it is possible that the help article is not documented. For more information, visit:
The help article for my check is missing
WCAG success criteria¶
3.3.2 Labels or Instructions
Labels or instructions are provided when content requires user input
3.3.2 Labels or Instructions
Introduction
This article provides information about the accessibility check:
- Labels or instructions are provided when content requires user input.
What
When a webpage includes input fields such as text boxes, dropdowns, or checkboxes that require user interaction, visible labels or instructions must always be present to describe the purpose of the input. These labels help users understand what information is expected and improve accessibility for assistive technologies.
This check ensures that:
- Every input field has a visible label that does not disappear when users interact with the field.
- The label provides clear and descriptive information about the required input.
- If additional instructions are needed, they are visible and persistently available to the user.
Why
This section provides information about why this check is important and provides some examples.
Why is this important?
- Improves accessibility: Users who rely on assistive technologies, such as screen readers, need properly labeled inputs to understand what to enter.
- Enhances usability: All users can complete forms accurately.
- Prevents confusion and input errors: Users are less likely to enter incorrect information or struggle to complete the form.
Examples
Pass examples
The label is explicitly associated with an input field
<label for="email">Email Address:</label>
<input type="email" id="email" name="email">
- Why this works:
- The label is always visible and clearly describes the expected input.
- The
for attribute correctly associates the label with the input field.
The input field has a persistent placeholder text and instructions
<label for="phone">Phone Number:</label>
<input type="tel" id="phone" name="phone" placeholder="Format: 123-456-7890">
- Why this works:
- The label remains visible at all times.
- The placeholder text provides additional guidance but does not replace the label.
Grouped radio buttons with a fieldset and legend
<fieldset>
<legend>Select your preferred contact method:</legend>
<input type="radio" id="email" name="contact" value="email">
<label for="email">Email</label>
<input type="radio" id="phone" name="contact" value="phone">
<label for="phone">Phone</label>
</fieldset>
- Why this works:
- The legend provides a clear description of the group of inputs.
- Each radio button has an associated visible label.
Fail examples
How
This section provides instructions on how to review and fix the issue.
How to review it
- Check all input fields to ensure that they have a visible label:
- Labels must not disappear when the user starts typing.
- Placeholder text alone is not a sufficient label.
- Ensure that labels describe the expected input clearly:
- Avoid vague labels such as Enter value. Be specific about the required information.
- Test the form with a screen reader:
- Ensure that labels are correctly associated with input fields and announced properly.
How to fix it
Always provide a <label> element for each input field and associate it with the for attribute.
Example:
<label for="fullname">Full Name:</label>
<input type="text" id="fullname" name="fullname">
Use fieldsets and legends for grouped inputs, for example radio buttons or checkboxes.
Example:
<fieldset>
<legend>Choose your gender:</legend>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
</fieldset>
Ensure that instructions are visible at all times and do not rely only on placeholders.
Additional resources
If you cannot find the help article for a specific check that is failing, it is possible that the help article is not documented. For more information, visit:
The help article for my check is missing
WCAG success criteria¶
3.3.2 Labels or Instructions