WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Placeholder instead of explicit label?

for

From: Jared Smith
Date: Jan 5, 2015 10:56AM


Lynn Holdsworth wrote:

> But there's definitely a school of thought that says title is
> sufficient where the design can't accommodate an explicit, visible
> label. Any thoughts on this?

This is only a viable option when there is a clear visual indication
as to what the function of the field is. Title alone on a text box,
for example, would never be suitable because, as Jukka noted, few
users would ever see it.

The function of a search field that is positioned on a page in a
manner consistent with search fields and that has a clearly identified
"Search" button adjacent to it would be apparent to sighted users. But
without adjacent "Search terms" text to associate as a label, the
field would still need an accessible name to be read to screen reader
users. In this limited case, title would be sufficient to provide this
accessible name. I, however, generally prefer using an off-screen
label instead.

Of note is that we shouldn't dissuade the use of placeholder in places
where it would be useful. We just shouldn't use it as an alternative
for a proper label.

See the webaim.org site. Our search field is visually distinctive, yet
the text box does not have adjacent label text. We instead use both
placeholder (to reinforce the function of the field for sighted users)
and an off-screen label (for screen reader users) to clearly indicate
the function of this field.

Jared