Skip to content
easeweb
Search topics

Required fields marked only by colour

A booking form marks required fields only by red labels, with no word, symbol or required attribute, so people who can't see the red can't tell which.

WCAG 2.2
SC 3.3.2ASC 1.4.1A
Required by
Section 508 · EN 301 549 (EU)
Broken class="is-required"
The accessibility problem illustrated: Colour vision:Do I have to fill this in?
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: on the broken form, the red labels now look like the rest, because colour was the only sign. Below it, check whether a screen reader hears "required".

Simulate Greyscale

Broken Can you fix this?

BrokenRequired shown only by a colour

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark required fields in words, and in the code

Before
BrokenRequired shown only by a colour
<style>  label { color: #4a4541; }  .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">
What is wrong3 points
  • People who can't see the red can't tell which fields are required. The only difference is the colour of the label, and the red and the grey are only 1.45:1 apart, where a difference in lightness needs 3:1 to count as a second cue.
  • People who do see the red still have to guess what it means: nothing on the page explains it.
  • A screen reader announces every field the same way: the code doesn't mark any field as required.
After

"required" in each required label

<style>  label { color: #4a4541; }</style> <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">
How it is fixed3 steps
  1. Write "(required)" into each required label. The word is part of the label, so everyone reads it in the same place as the field's name, and needs no key.
  2. Add the required attribute, which tells assistive technology the same thing: a screen reader says "Full name (required), edit text, required".
  3. Drop the red class, so the labels are all the same dark grey and colour no longer carries anything.

This fixes the Before and passes 3.3.2 and 1.4.1. You can keep the red as extra styling on the word, as long as the word is there.

Easily confused
04

Design ideas

“Required” needs a word, or a mark that is explained

Four ways to show that Email must be filled in and Phone need not. Picture each one without colour, and Tab through the last one: two say which field is required before you type, and two leave you to guess or to find out.

In the design file

  • Put the word “(required)” or “(optional)” in the label, next to the field name, not in the grey example text or a tooltip.
  • If you use a mark such as an asterisk, explain it in a line just above the first field.
  • For a set of radio buttons or checkboxes, write the word once in the group’s heading, not on each option.
  • Write the red’s contrast ratio next to its colour. The example has 6.54:1 for the word on white and 5.58:1 for the badge on its pale background.

Passes

  • “Required” as a pill in the label The word set as a soft pill beside the label, #b3261e on a #fbe9e7 tint at 5.58:1: it catches the eye like a colour mark but still reads in greyscale, and it is the 必須 badge many Japanese forms already use. Keep the pill inside the label, so it is part of the field’s name.
  • Required
    Optional
    Required and optional fields in two groups The fields sit under two section headings, “Required” and “Optional”, so one word covers every field below it and people see at a glance how much they must do. W3C technique H90 lets a group’s legend carry the required state instead of each label; the headings are #4a4541, 9.46:1.

Fails

  • An asterisk nobody explainedWCAG 3.3.2 A bold #b3261e star after the Email label, 6.54:1, and no line anywhere saying what it means, so only people who already know the convention read it as “required”. H90 asks for a symbol’s meaning before its first use.
  • “Required” only after you leave the fieldWCAG 3.3.2 Both fields look the same until you Tab out of Email with it empty; only then does “Enter your email address” appear under it, in #b3261e at 6.54:1. The message is clear, but people learn the rule only by breaking it, and 3.3.2 asks for it before they type.
05

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. An explaining line that only names a colour or a symbol's look, such as "fields in red are required", is itself one of the instructions that rely on colour, shape or position. 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.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service