WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: labeling form elements for time

for

From: Jukka Korpela
Date: Apr 17, 2002 10:54PM


Mary Utt wrote:

> I am coding a form that asks the user to enter a time of day.

I think the first accessibility issue is to make it as clear as possible,
and preferably clearer than that, what exactly the user is expected to enter
and how it will be interpreted. For example, should it be by 12 hours clock
or 24 hours clock, and what exactness is expected or allowed.

> We are using two select boxes, one for hours (0-24) and one for
> minutes (:00, :15, :30, :45). They are positioned side by side.

I would use a text input box, 5 characters wide, naturally preceded by a
suitable explanation. It is actually faster to almost anyone to type the
time than to select from menus. And much faster and more convenient to a
considerable number of people. Think about the user listening to the
alternatives: zero, one, two, ...

This is one of the cases where JavaScript, properly used, can improve
accessibility. Using various event handlers, you could trap some typing
errors early, so that when JavaScript is enabled, the user gets fast
feedback if he tries to enter, say, "2 PM" (unless, of course, you wish to
allow that format too and process it in the server-side form handler).

--
Jukka Korpela
TIEKE Tietoyhteiskunnan kehitt