W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] [WF2] Clear On Focus attribute

From: Charles Iliya Krempeaux <supercanadian@gmail.com>
Date: Wed, 23 May 2007 10:02:26 -0700
Message-ID: <84ce626f0705231002u16adb64as17f89bb3f0831ed4@mail.gmail.com>
Hello Alexey,

On 5/23/07, Alexey Feldgendler <alexey at feldgendler.ru> wrote:
> On Wed, 23 May 2007 02:31:38 +0200, Charles Iliya Krempeaux
> <supercanadian at gmail.com> wrote:
> > You need a label for the field... but don't want to put one beside it.
> >  So the label goes inside the field... until you click on it.  (At
> > which point the label disappears.)
> The field's value shouldn't be abused to achieve this effect because the
> label is not a value. Stylesheets should be used to get a semantically
> appropriate piece of information, such as the field's title, to display in
> the box when the field is empty and has no focus.

It's true that web developers probably should not be doing this.
(Since it messes up semantics.)  But they are.

So... perhaps we can come up with a way for them to get this effect,
while preserving semantics.

Maybe a new attribute?  "innerlabel" maybe... or something like that.

So, maybe something like....

<input type="search" innerlabel="search in vancouver...">

(And this would have the effect described in the original post.  I.e.,
a text input box with "search in vancouver..." inside of it.  When the
use clicks in the text input box, that text disappears.)

(Although maybe a new "innerlabel" attribute is the wrong way to do
this.  Perhaps a combination of the <label> element and the <input>
element can be used for this... BUT where CSS can be extended somehow
to put the text of the <label> into the text <input> box.)

See ya

    Charles Iliya Krempeaux, B.Sc.

    charles @ reptile.ca
    supercanadian @ gmail.com

    developer weblog: http://ChangeLog.ca/
Received on Wednesday, 23 May 2007 10:02:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC