Skip to content

FRM-001 Give every form control a visible label

Level
Rule
Verdict
Majority (2 of 3)
Area
Forms
Status
decided, version 1.1.0

Rule

Give every form control a label that people can see at the control, beside it, above it or on its border, before, while and after they fill it in, and never let placeholder text stand in for that label.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: A label above every field

For example 19:30. The last table is at 21:30.

Each label sits above its field and stays there. Number of guests is already filled in, and you can still see what the 4 means. The time format is hint text under the label, not inside the field.

Don't: Placeholders instead of labels

The second field already holds 4, and nothing says what it is. Type a time in the third field and its format disappears just when you need it.

Why

A label is how a person knows what a field wants, and they need to know it at every step: before they start, halfway through a long number, and when they look over their answers before sending. Text inside an empty field is gone at the first keystroke, so it cannot do that job. WCAG 2.2, 3.3.2 Labels or Instructions asks for labels or instructions where people enter something. It supports this rule and does not require all of it. This rule is about the label people see. The name the control carries in code, and how it relates to the label, is FRM-010.

Do

  • Put a short label above each text field. A field for a national identity number gets the label "National ID number" above it.
  • Put anything people need to fill a field correctly in visible hint text outside the field, such as "12 digits, YYYYMMDDNNNN" under the label "National ID number".
  • Label every kind of control, not only text fields: selects, comboboxes, date and number fields, checkboxes, radio buttons and switches. For a checkbox or a switch, put the label right beside it and name the setting it changes, such as "Email me a receipt".
  • Give a group of radio buttons or checkboxes a visible group label, such as "Delivery method" over "Collect in store" and "Home delivery". How the group label is tied to the group in code is FRM-010.
  • Prefer a label that sits outside the field and never moves. A floating label that starts inside an empty field and moves to its edge on focus is fine, as long as it stays visible and readable the whole time.
  • Give each control a name in code that contains its label's text, as FRM-010 requires. Tying the label to the control in code does that, and the Field component does it for you.
  • If you add placeholder text, treat it as an optional extra. The field must make sense without it, and the text must still be easy to read.

Don't

  • Build a booking form where "Number of guests" and "Preferred time" exist only as grey text inside the fields.
  • Hide the label from view and give the control a name only through aria-label.
  • Put a required format, such as "NNNNNN-NNNN" for a company registration number, only in the placeholder of the field.
  • Label a switch only "On" or "Off", or leave it with no text beside it.
  • Let a floating label shrink, get cut off or fade away once a value is entered.

Exceptions

A single control may go without its own label text when visible text right beside it makes its purpose plain, such as a lone search field next to a button that reads "Search". Even then the control needs a name in code, as FRM-010 requires. Short or familiar forms, such as sign-in, are not an exception.

Verdict

Majority (2 of 3). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on FRM-001
SourceRoleStancePage
WCAG 2.2LawSupports3.3.2 Labels or Instructions
WCAG 2.2LawSupports2.4.6 Headings and Labels
WCAG 2.2LawSupports1.4.3 Contrast (Minimum)
Material DesignJudge SupportsText fields: guidelines
Apple Human Interface GuidelinesJudge OpposesText fields
Entering data
Carbon Design SystemJudge SupportsText input: usage
Forms
GOV.UK Design SystemExpert witness SupportsText input
Nielsen Norman GroupExpert witness SupportsPlaceholders in Form Fields Are Harmful, by Katie Sherwin

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.1.0, : Narrowed to the visible label. The name in code is now FRM-010.
  • Version 1.0.1, : Examples in English.
  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Forms: 15 rules and 12 guidelines · All rules