[whatwg] Placeholder option for text input boxes

Tab Atkins Jr. jackalmage at gmail.com
Sat Oct 4 17:55:39 PDT 2008


On Sat, Oct 4, 2008 at 7:41 PM, Andy Lyttle <whatwg at phroggy.com> wrote:

> On Oct 4, 2008, at 3:38 PM, timeless wrote:
>
> On 10/3/08, Adrian Sutton <adrian.sutton at ephox.com> wrote:
>>
>>>  Placeholder ... aids usability
>>>
>>
>> having recently fought with some javascript which tried to enhance my
>> ability to enter text ('crash' in a keyword chooser using nokia's
>> webkit based browser on my phone), I'd like to remind people that
>> someone's "usability" aid is someone else's nightmare. the problem
>> there didn't need solving as the browsers we have either support
>> remembering text-input or have keyboard support or are so slow that
>> the chooser hangs them....
>>
>> i use quite a few browsers where javascript is disabled and in many of
>> them, clearing a text field is extremely painful (especially the phone
>> cases).
>>
>
> The existence of a "placeholder" attribute in HTML should discourage web
> developers from using crazy Javascript hacks that don't work correctly on a
> cell phone.  In particular, it means NOT "faking it" by setting the value of
> the field to an obnoxious string that doesn't get cleared.  Browser
> developers such as Nokia can display placeholder text in whatever way makes
> the most sense on their platform, without using JavaScript at all.
>
> Most mobile browsers I've used switch to a text input dialog as soon as the
> control is focussed.  I would display the placeholder on the web page the
> same way any other browser would, but not display it on the text input
> dialog.  Someone else might choose to go ahead and display it on the text
> input dialog as well (above the input field), with the placeholder text not
> disappearing while text is being entered.


The great thing about this being a *semantic* issue rather than a display
issue is that browsers are free to do precisely that - display the hint in
whatever way makes the most sense for them and is the most useful for their
users and platform.

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081004/85e1492a/attachment-0001.htm>


More information about the whatwg mailing list