WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Do you need to have a label on a form field when it has a default value?

for

From: Jukka K. Korpela
Date: Sep 17, 2010 2:27PM


William Lawrence wrote:

> It is a best practice to never use place-holding characters in edit
> boxes and text areas by default unless the text is included after
> processing the user’s input, the semantics of the document naturally
> would include such characters, or the characters were previously
> entered by the user, e.g., in the case of refining a previous search.

Well, I guess the point is that "place-holding characters" should never be
used, but a form field might, and often should, be initialized to a
meaningful default value that is suitable to a large number (typically,
majority) of users. The logic of such initialization may vary. It may depend
on user data, or it may depend on external factors, like defaulting a date
field to current date when that makes sense.

> In the event that the place-holder text is to be used, then it must
> disappear when focus is achieved in that form control element that is
> not device dependant.

I wonder how that would be accomplished. If you clear (reset to empty
string) a field when focused on, then you will also destroy actual user
input when the user enters some data, proceeds to another field, and then
returns to a previous field for whatever reason.

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