WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: proper use of labels

for

From: Jukka K. Korpela
Date: Jun 16, 2005 4:35AM


On Thu, 16 Jun 2005 <EMAIL REMOVED> wrote:

> I just wish to make a quick comment- I think the title attribute is
> potentially very useful but there are issues with it.

The real issue is: you should use the title attribute only when it is not
needed. (You cannot rely on its being presented to the user. Hence, it
should contain no information that is _necessary_.)

> > <label for="date">todays date (dd-mm-yy): <input type="text"
> > name="date" id="date" title="enter todays date as two numbers each for
> > day, month and year, separated by a dash." /></label>
>
> The above code is fine

No, it isn't, since the required data format is neither natural to most
people nor standards-conforming. It strongly violates the international
standard ISO 8601, which prescribes that dd-mm-yy is to be interpreted so
that dd denotes year, mm denotes month, and yy denotes day.

It is currently impossible to create Web pages with localized formats for
dates; attempts to use them cause just confusion. Using ISO 8601
(yyyy-mm-dd) might work in some contexts, but in most cases, the date
should be specified in three different fields, each with its own label.
This consumes some space, but we are not designing a compact paper form,
are we?

In this case, the title attribute does not help much. Anyone who needs the
information in it should instead see it as normal text before the field.
On a typical graphic browser, it is just too inconvenient to read longish
tooltips, and common to ignore tooltips since they are so often used so
pointlessly.

And after fixing the real problem (reading a date as a whole, despite the
fact that different people have very different ideas of how dates are
written), there is no need for a title attribute.

> > enter todays date as two numbers each for
> > day, month and year, separated by a dash
>
> explains it very well.

Does it? That makes _three_ numbers in my book. Maybe you meant _digits_?
Promoting the use of two-digit year denotations is asking for trouble, by
the way. But my point is that attempts at explaining things so often turn
into confusing distractions.

> Having
> said that though I do think the title attribute is very useful and can
> be used, if a screen reader picks up on it fine, if not fine, just make
> sure you don't put anything in their that they *need* to know.

I would say that title attributes are useful for links, properly used,
and mostly useless or worse for other elements. When a user mouses over a
link, it is quite natural to expect that some advisory information about
the destination is given, so that the user can make a better decision on
following the link and can prepare herself for the page to come. This
paradigm has been promoted by Jakob Nielsen, the usability specialist,
and it is fairly often applied and found useful. Using title attributes
for something rather different tends to obscure things; people may even
think something is a link because it has a tooltip!

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/