Sub topic 8
Form Labels, Placeholders and Helper Text
Start with the user’s task
Assume you know common web forms, HTML inputs, and basic accessibility concepts. This chapter focuses on choosing and arranging the words around a field so users know what to enter and can recover from mistakes.
A form label names the information a field collects. Helper text adds useful guidance, such as format, purpose, or limits. A placeholder is temporary example text inside an empty field. These elements have different jobs.
Start by asking:
- What does the user need to provide?
- Why does the product need it?
- What format or restrictions apply?
- What information would prevent a likely mistake?
A label should remain visible after the user starts typing. Do not use a placeholder as the only label because it disappears and may not be announced reliably by assistive technology.
Write labels that identify the answer
Use the name users expect, not the name used in your database or implementation. “Email address” is clearer than contact_primary or “Email field.”
Prefer labels that are:
- Specific: “Delivery address” instead of “Address”
- Familiar: “Phone number” instead of “Telephone contact identifier”
- Consistent: use “Postal code” everywhere if that is your chosen term
- Short enough to scan, but complete enough to distinguish nearby fields
A label should usually be a noun phrase. Put instructions about format or purpose in helper text instead of making the label long.
Use helper text for useful guidance
Helper text earns its space when it answers a question before the user asks it. For example, “Use the address where we should deliver your order” explains purpose. “Enter 8–20 characters” explains a constraint.
Do not repeat the label in the helper text. Do not add vague instructions such as “Please provide valid information.” State the actual requirement.
Keep helper text next to the field and programmatically associate it with that field. This allows a screen reader to announce the label and guidance together.
<form>
<label for="email">Email address</label>
<p id="email-hint">We'll send your receipt here.</p>
<input
id="email"
name="email"
type="email"
autocomplete="email"
aria-describedby="email-hint"
>
<button type="submit">Send receipt</button>
</form>Treat placeholders as examples
A placeholder can show the expected pattern when an example is more helpful than a rule. For example, [email protected] demonstrates an email format. It should not contain essential instructions, because users lose sight of it while typing.
Avoid low-contrast placeholder text. Never use a placeholder to replace a visible label. If a field needs an example, keep the example short and make the rule available as persistent helper text when the rule matters.
Connect errors to the field
When validation fails, preserve the label and helper text, then add an error that explains the problem and the next action. “Invalid input” describes a system state. “Enter an email address like [email protected]” tells the user how to recover.
Set the field’s invalid state and associate the error message with aria-describedby. Avoid moving the user’s focus unexpectedly unless the product has a clear, tested form pattern.
Exercise
A form has the label “Password,” the placeholder “Required,” and the error “Invalid.” What should you change?
Show answer
Keep the visible “Password” label, remove the nonessential placeholder, and replace the error with a specific recovery instruction such as “Use 8–64 characters, including at least one number.”