Categories
HTML Accessibility

super short note: placeholder perfidy

A cartoon portrayal of the Laukestar naked, sitting on a rock on the bad side of the moon, contemplating WCAG 3 "I am tired of Earth. These people. I am tired of being caught in the tangle of their lives."
Patrick muses upon his Web Standards life, from the bad side of the moon

It’s a hint not a label

The placeholder attribute is defined as:

The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.

The placeholder attribute should not be used as an alternative to a label.

I made the mistake in a recent article of using the placeholder attribute content to illustrate when a label is not correctly associated it does not provide an accessible name. placeholder content is used as an accessible name of last resort when other sources are absent. My motivation for using it was to include the names of my nearest and dearest friends (Dr Throater for example!) in some form as I often do, not to give people the idea to use placeholder themsleves, for anything!.

For this I am truly sorry. I did not mean to imply that it was a good idea, in fact its a really shit idea for lots of reasons.

The HTML Accessibility API Mappings 1.0 name computation for input type="text" (amongst others) details where placeholder is in the acc name source pecking order:

Further reading

Further listening: Toe Fat 1970 – Bad Side Of The Moon

Lyrics
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life

It seems as though I've lived my life
On the bad side of the moon
To stir your dregs in sickness still
Without the rustic spoon
Come on people, live with me
Where the light never never shone
And the hermits flock like-a hummingbirds
To speak in a foreign tongue

I'm a light world away
From the people who make me stay
Sitting on the bad side of the moon
Yeah, I'm a light world away
From the people who make me stay
Sitting on the bad side of the moon

Everybody sing
This is my life, this is my life, this is my life
This is my life, this is my life, this is my life

 

2 replies on “super short note: placeholder perfidy”

Leave a Reply

Your email address will not be published. Required fields are marked *