[whatwg] [WF2] Clear On Focus attribute
Charles Iliya Krempeaux
supercanadian at gmail.com
Wed May 23 10:02:26 PDT 2007
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.)
Charles Iliya Krempeaux, B.Sc.
charles @ reptile.ca
supercanadian @ gmail.com
developer weblog: http://ChangeLog.ca/
More information about the whatwg