# Accessible Forms: Labels, Errors and Keyboard

Source: https://allyway.ai/glossary/accessible-forms

Accessible forms are forms that everyone can understand and fill in: every field has a visible label tied to it in the code, instructions explain required formats, errors are named in text, and every control works with a keyboard. Their core rule is WCAG 3.3.2 Labels or Instructions at Level A.

Accessible forms are forms that every visitor can complete – with a screen reader, with only a keyboard, with voice control or simply on a small phone in a hurry. Contact forms, checkouts, logins and newsletter sign-ups are where websites turn visitors into customers, so a form that people cannot fill in costs real business. Most problems come down to a handful of patterns: missing labels, unclear formats, vague errors and controls that only react to a mouse.

## What it means

The central rule is [WCAG 3.3.2 Labels or Instructions](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html) (Level A, part of [WCAG 2.2](https://allyway.ai/regulations/wcag-2-2)): "Labels or instructions are provided when content requires user input." W3C clarifies that "requires" means accepts or expects – so optional fields need labels too. Radio buttons and checkboxes need labels that say what choosing them does, and unusual formats or rules should be explained.

Several other criteria complete the picture of accessible web forms:

| Criterion | Level | What it covers in a form |
|---|---|---|
| 1.3.1 Info and Relationships | A | Label and field are linked in the code, groups use `fieldset` and `legend` |
| 2.1.1 Keyboard | A | Every field, custom select and button works without a mouse |
| 3.3.1 Error Identification | A | An error names the field and describes the problem in text |
| 3.3.2 Labels or Instructions | A | Labels, required-field hints and format instructions |
| 1.3.5 Identify Input Purpose | AA | Personal data fields carry `autocomplete` |
| 4.1.2 Name, Role, Value | A | Every control has an accessible name |

The detailed rules for each field label are explained under [form labels](https://allyway.ai/glossary/form-labels); a field without any label is covered in [missing form label](https://allyway.ai/glossary/missing-form-label).

> **Note:** > **Enough guidance, not too much**
> W3C stresses that too much text can hinder users as much as too little. Long instructions can be shown when a field receives focus instead of in front of the whole form.

## Examples

```html title="Example"
<form>
  <p>Fields marked with * are required.</p>

  <label for="email">Email address *</label>
  <input id="email" type="email" autocomplete="email" required
         aria-describedby="email-hint">
  <p id="email-hint">We only use it to reply to you.</p>

  <fieldset>
    <legend>Preferred contact</legend>
    <input type="radio" id="c-mail" name="contact" value="mail">
    <label for="c-mail">Email</label>
    <input type="radio" id="c-phone" name="contact" value="phone">
    <label for="c-phone">Phone</label>
  </fieldset>

  <label for="date">Date of birth (DD.MM.YYYY)</label>
  <input id="date" autocomplete="bday" inputmode="numeric">

  <button type="submit">Send message</button>
</form>
```

Each field has a `label` tied to it with `for` and `id`, the hint is linked with `aria-describedby`, the radio group has a `legend`, and the date format is stated in the label (W3C technique G89). The `autocomplete` values follow [input purpose](https://allyway.ai/glossary/input-purpose), so browsers can fill in the data.

**Do:** Do

Use visible `label` elements, say which fields are required in text, state formats up front, group related options with `fieldset` and `legend`, and name errors next to the field in words.

**Don't:** Don't

Rely on placeholder text as the only label, mark required fields with color alone, split a phone number into unlabeled boxes (W3C failure F82), or show errors only as a red border.

## How to check accessible forms



## Questions

Q: What makes a form accessible?
A: Every field has a visible label that is linked to it in the code, instructions explain required fields and formats, errors are described in text, and every control works with a keyboard. Together these cover WCAG 1.3.1, 2.1.1, 3.3.1, 3.3.2 and 4.1.2.

Q: Is a placeholder enough as a label?
A: No. A placeholder disappears as soon as someone types, often has low contrast and is not a reliable label for every screen reader. Use a visible `label` and keep the placeholder for an optional example.

Q: Do optional fields need labels too?
A: Yes. W3C explains that "requires user input" in WCAG 3.3.2 means accepts or expects input, so optional fields need labels as well. Mark the optional or required fields in text, not with color alone.

Q: How should required fields be marked?
A: State it in text – a note such as "Fields marked with * are required" at the start of the form, or the word "required" in the label – and add the `required` attribute so assistive technology announces it too.

Q: Are accessible forms required by the European Accessibility Act?
A: The [European Accessibility Act](https://allyway.ai/regulations/eaa) refers to [EN 301 549](https://allyway.ai/glossary/en-301-549), which takes over WCAG Level AA for websites. Labels or Instructions (3.3.2) is Level A and therefore part of it.
