W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2008

[whatwg] Placeholder option for text input boxes

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 3 Oct 2008 18:35:29 -0500
Message-ID: <dd0fbad0810031635g489d7258x5ebd287759fa6be6@mail.gmail.com>
On Fri, Oct 3, 2008 at 5:04 PM, Andy Lyttle <whatwg at phroggy.com> wrote:

> On Oct 3, 2008, at 1:31 PM, Adrian Sutton wrote:
>
>  On 03/10/08 20:56, "Nils Dagsson Moskopp"
>> <nils-dagsson-moskopp at dieweltistgarnichtso.net> wrote:
>>
>>> Am Freitag, den 03.10.2008, 20:41 +0100 schrieb Adrian Sutton:
>>>
>>>> <label for="date">Date: <input type="text" placeholder="1 Jan 2008"
>>>> id="date" /></label>
>>>>
>>> Wouldn't three comboboxes be more appropriate ?
>>>
>>
>> While that's a common solution it's a terribly inefficient and frustrating
>> user interface. Besides, the specific examples aren't as important as the
>> idea that placeholder is an excellent way to provide suggestions and thus
>> distinct from the label of the field.
>>
>
> Exactly, that was my point as well.  People have been saying that the only
> places they've noticed a placeholder being used, it was performing the job
> of a label, but if it were easy to use (a simple attribute instead of lots
> of JavaScript hacking), I think it would be used appropriately as a hint
> more often.  Yes, it would also be abused, but what else is new?  If we
> provide a good way to do it right, designers who care about doing it right
> will do it right, and the ones who don't will continue to do whatever they
> want.
>
> Obviously <input type="date"> kicks ass for this particular example.


Man, I could *really* see the "hint" function being viable and quite
useful.  It offers up a completely new-and-useful semantic, and there's no
particular place it should already go.  I'd accept this as a new attribute
without reservation if it was renamed @hint, so it's absolutely clear what
the semantic for it is.

We can then delay any questions of generalizing this function with CSS until
later, and get this pushed into html5 immediately.

For now, people wanting to use hint-like appearance for their labels but
stay semantic can just use the established javascript hackery.

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081003/4bfd14b7/attachment.htm>
Received on Friday, 3 October 2008 16:35:29 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:06 UTC