This article provides information about the Acquia Optimize check:
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:
This section provides information about why this check is important and provides some examples.
The label is explicitly associated with an input field
<label for="email">Email Address:</label>
<input type="email" id="email" name="email">
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">
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>
Missing a visible label
<input type="text" name="username">
Fix:
<label for="username">Username:</label>
<input type="text" id="username" name="username">
Placeholder text used instead of a label
<input type="text" name="email" placeholder="Enter your email">
Fix:
<label for="email">Email Address:</label>
<input type="email" id="email" name="email" placeholder="[email protected]">
Labels that disappear on focus
<input type="password" name="password" aria-label="Password">
Fix:
<label for="password">Password:</label>
<input type="password" id="password" name="password">
This section provides instructions on how to review and fix the issue.
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.
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:
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Thu Mar 27 2025 11:26:02 GMT+0000 (Coordinated Universal Time)