[whatwg] Placeholder option for text input boxes

Tab Atkins Jr. jackalmage at gmail.com
Fri Oct 3 16:35:29 PDT 2008


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-0001.htm>


More information about the whatwg mailing list