Skip to content
Search topics

Required fields marked only by colour

A booking form colours the labels of its required fields red, with no word, symbol or required attribute, so only people who see the colour and guess its meaning know which fields they must fill in.

Broken
Required? Nothing says so.
The accessibility problem illustrated.
01

The problem

People who can't see the red, or don't know what it means, find out which fields are required only when the form is sent back.

02

Try it

Which fields must you fill in? Decide, then press Tab through the form.

Turn on greyscale to see the form without colour. Below it, check whether a screen reader hears "required".

Broken Can you fix this?

Screen reader hears

(Tab to a field)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Say it in words in the labels, and add the required attribute to the same fields.

  1. 1Show which fields are required in visible text, in the label or explained before the first field.
  2. 2Give every required field the required attribute, and only those.
  3. 3Don't let colour, bold or a placeholder be the only sign.
Before Required shown only by a colour
<style>  .is-required { color: #b3261e; }</style> <label for="name" class="is-required">Full name</label><input id="name" name="name" type="text" autocomplete="name"> <label for="email" class="is-required">Email</label><input id="email" name="email" type="email" autocomplete="email"> <label for="phone">Phone</label><input id="phone" name="phone" type="tel" autocomplete="tel"> <label for="diet">Dietary needs</label><input id="diet" name="diet" type="text">
After

"required" in each required label

<label for="name">Full name <span class="req">(required)</span></label><input id="name" name="name" type="text" autocomplete="name" required> <label for="email">Email <span class="req">(required)</span></label><input id="email" name="email" type="email" autocomplete="email" required> <label for="phone">Phone</label><input id="phone" name="phone" type="tel" autocomplete="tel"> <label for="diet">Dietary needs</label><input id="diet" name="diet" type="text">

04

Verify the fix

4 checks, no mouse.

Test with: Keyboard, Screen reader, Zoom

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat when fields are added to the form or the shared field component changes.

Limits

This is a starting pattern, not a guarantee for every application. It covers how people learn which fields are required before they type, not the error messages they see afterwards. Formats, such as a date order or a postcode pattern, are instructions too, and need their own text. Forms built by third-party widgets or content editors need the same check. Test the complete journey with your target assistive technology.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work