W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

Re: [whatwg] Hide placeholder on input controls on focus

From: Markus Ernst <derernst@gmx.ch>
Date: Tue, 19 Mar 2013 10:16:08 +0100
Message-ID: <51482CD8.4090802@gmx.ch>
To: Glenn Maynard <glenn@zewt.org>
Cc: whatwg@lists.whatwg.org, Tim Streater <tim@clothears.org.uk>, Boris Zbarsky <bzbarsky@mit.edu>
Am 19.03.2013 00:44 schrieb Glenn Maynard:
> On Mon, Mar 18, 2013 at 12:51 PM, Markus Ernst <derernst@gmx.ch> wrote:
>
>> A reason for the behaviour of Firefox and Chrome may be that some user may
>> not have read the placeholder text before focusing the control. Anyway, if
>> this behavior lets some users think they can't even fill in the form, there
>> must be something wrong about it.
>>
>
> I've seen browsers (or maybe pages emulating placeholder in script) that
> hide the placeholder text while the input field is focused.  When the
> placeholders are labels for the inputs, it's incredibly annoying to have to
> focus something else in order to see the placeholder text.  If placeholders
> are meant to be useful and not just eyecandy, they need to remain visible
> until the user enters something.
>

The spec does clearly say: "The placeholder attribute should not be used 
as an alternative to a label."
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-placeholder-attribute

Thus, the use case you mention is an authoring mistake. I am sure that 
the spec should weigh possible confusion of unexperienced users higher 
than problems caused by authoring mistakes. (Also, misusing the 
placeholder as a label is potentially annoying once the value of the 
control is not the empty string anymore: As you can't even focus 
someting else in order to see the placeholder text, you will have to 
delete whatever you have typed before.)

Anyway, both your and my use cases may be worked around by an obvious 
visual distinction of the placeholder in focused fields. E.g. the 
placeholder text may be rendered almost transparent when the control has 
focus. There must be something that indicates an unexperienced user that 
(s)he can enter text now, which is not the case in the current 
implementations of Firefox and Chrome.

(I must admit I am surprised about this discussion. Huge efforts are 
made in HTML development to enhance accessibility by removing obstacles 
for various groups of users. I am reporting an obstacle. Of course the 
problem will lose weight once placeholders are commonly known, but it is 
still a source of confusion.)
Received on Tuesday, 19 March 2013 09:16:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 19 March 2013 09:16:40 GMT