WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Include default text?

for

From: Derek Featherstone
Date: Oct 21, 2004 5:16PM


On Thursday, October 21, 2004 5:42 PM, steven.faulkner wrote:
> If want to include default place holders, you can use
> JavaScript to clear a field of its default text on focus.
>
> Example:
> <input type="text" size="3" value="default text"
> onfocus="if(this.value=='default text'){this.value=''}" />

Of course, in non-JS capable browsers (like on my PDA for example), or where
JS is off, this default value will be a nuisance. If we are relying on JS to
clear it, perhaps we should use appropriate DOM methods to place the default
there instead, if and only if the JS is available? It would certainly be
more universal and you'd be able to be more confident that the JS could be
used properly to clear it out...

Just my 2 cents...

Best regards,
Derek.
--
Derek Featherstone <EMAIL REMOVED>
phone: 613.599.9784; toll-free: 1.866.932.4878 (North America)
Web Accessibility: http://www.wats.ca
Personal: http://www.boxofchocolates.ca