W3C home > Mailing lists > Public > public-html@w3.org > February 2013

Re: use of placeholder as a label for an input

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 18 Feb 2013 23:09:30 -0800
Cc: HTMLWG WG <public-html@w3.org>, Steven Faulkner <faulkner.steve@gmail.com>
Message-id: <1E858663-1861-4179-8B38-140C67E132D2@apple.com>
To: Kenneth Nordahl <kenneth@dpd.im>

On Feb 18, 2013, at 11:01 PM, Kenneth Nordahl <kenneth@dpd.im> wrote:

> Hi,
> 
> During implementasjon i often visually hide labels (either offset the text or zero opacity) in browsers that supports placeholder.
> 
> I'm under the assumption that the label element is required for making the inputs accecable.

WebKit's implementation exposes the placeholder value via accessibility APIs, so even for accessibility a visually hidden label is not needed. I would expect this to be the case for other browsers that support placeholder. That's why I'm puzzled at Steve's claim that placeholder alone is inadequate.

(For polyfilled fallback, it's probably appropriate to add an aria-label attribute to the control, but duplicating the placeholder with identical label text would be bad in browsers that properly expose placeholder to AX APIs.)

 - Maciej


> 
> As Maciej mentioned it would be great to see why placeholder alone isn't enough.
> 
> 
> 
> ​
> —
> Kenneth
> Sent from Mailbox for iPhone
> 
> On tir., feb. 19, 2013 at 7:35 AM, Maciej Stachowiak <mjs@apple.com="mailto:mjs@apple.com">> wrote:
> 
> As an additional note note, Safari and Firefox both have text fields with placeholders but no visible labels, namely the address field when no URL has been entered. To persuade websites not to follow this reasonably common native idiom will require a good explanation.
> 
>  - Maciej
> 
> On Feb 18, 2013, at 10:28 PM, Maciej Stachowiak <mjs@apple.com> wrote:
> 
>> 
>> <chair hat off>
>> 
>> I think there are two counterpoints to consider:
>> - It's generally not a great idea to have MUST NOT criteria that are not machine checkable; whether placeholder is being used a "an alternative to label" depends on intent and interpretation of the contents.
>> - This pattern appears to be pretty common and a MUST NOT seems
>> 
>> Also: You haven't explained why using a palceholder without any other label is insufficient. To make this concrete, consider the search box on <http://www.reddit.com>, which has a placeholder of "search reddit" and no other label. What concretely is the problem with this? There may be a reason this is bad, but you have not explained to the WG what it is.
>> 
>> Regards,
>> Maciej
>> 
>> 
>> On Feb 18, 2013, at 8:54 AM, Steve Faulkner <faulkner.steve@gmail.com> wrote:
>> 
>>> The HTML spec currently states [1]:
>>> 
>>> The placeholder attribute should not be used as an alternative to a label.
>>> 
>>> should this be tighened up to MUST NOT?
>>> 
>>> 
>>> I believe there are cases where having a label associated using the label element may not be required, but can't think of any cases where the placholder attribute text suffices as the only label for an input.
>>> 
>>> thoughts?
>>> 
>>> 
>>> 
>>> [1] http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute
>>> -- 
>>> with regards
>>> 
>>> Steve Faulkner
>>> 
>> 
> 
> 
> 
> On Tue, Feb 19, 2013 at 7:35 AM, Maciej Stachowiak <mjs@apple.com> wrote:
> 
> 
> As an additional note note, Safari and Firefox both have text fields with placeholders but no visible labels, namely the address field when no URL has been entered. To persuade websites not to follow this reasonably common native idiom will require a good explanation.
> 
>  - Maciej
> 
> On Feb 18, 2013, at 10:28 PM, Maciej Stachowiak <mjs@apple.com> wrote:
> 
>> 
>> <chair hat off>
>> 
>> I think there are two counterpoints to consider:
>> - It's generally not a great idea to have MUST NOT criteria that are not machine checkable; whether placeholder is being used a "an alternative to label" depends on intent and interpretation of the contents.
>> - This pattern appears to be pretty common and a MUST NOT seems
>> 
>> Also: You haven't explained why using a palceholder without any other label is insufficient. To make this concrete, consider the search box on <http://www.reddit.com>, which has a placeholder of "search reddit" and no other label. What concretely is the problem with this? There may be a reason this is bad, but you have not explained to the WG what it is.
>> 
>> Regards,
>> Maciej
>> 
>> 
>> On Feb 18, 2013, at 8:54 AM, Steve Faulkner <faulkner.steve@gmail.com> wrote:
>> 
>>> The HTML spec currently states [1]:
>>> 
>>> The placeholder attribute should not be used as an alternative to a label.
>>> 
>>> should this be tighened up to MUST NOT?
>>> 
>>> 
>>> I believe there are cases where having a label associated using the label element may not be required, but can't think of any cases where the placholder attribute text suffices as the only label for an input.
>>> 
>>> thoughts?
>>> 
>>> 
>>> 
>>> [1] http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute
>>> -- 
>>> with regards
>>> 
>>> Steve Faulkner
>>> 
>> 
> 
> 
Received on Tuesday, 19 February 2013 07:10:12 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:37 UTC