W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] LABEL and radio/checkbox onclick

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Wed, 18 Aug 2004 09:16:26 -0400
Message-ID: <412356AA.7050801@earthlink.net>
Ian Hickson wrote:
> Hmm, yes. This is platform-dependent, though. Added:
> 
>   <p>The <code>label</code> element's exact default behaviour must
>   match the platform's label behaviour. For example. on platforms
>   where clicking a checkbox label checks the checkbox, clicking a
>   <code>label</code> element must cause a <code>click</code> event to
>   be synthesised and fired at the checkbox.</p>

    There are a few problems with this:

1) When HTML 4.01 markup is transferred to a WF2 document, the <label> 
behavior changes for the same markup with absolutely NO WAY TO RECOVER 
THE PREVIOUS BEHAVIOR.

2) The webmaster cannot reliably predict the behavior of <label> on a 
platform without extensive knowledge of that platform. Therefore, if the 
webmaster is targeting a specific set of operating systems and browsers, 
he must have knowledge of how the native UI handles labels for each 
control he uses, rather than simply depending on the HTML 4.01 specified 
behavior.

3) You're providing no method of detecting whether input is passed to 
the associated control. Therefore, is there not a risk of multiple 
events being fired at the control when Javascript is introduced to make 
up for the lack of event passing on some platforms?

4) There's absolutely no way to know how <label> should behave when 
associated with an <object> element.

    Please see the following message for what I believe to be a better 
solution:

http://listserver.dreamhost.com/pipermail/whatwg-whatwg.org/2004-August/001764.html
Received on Wednesday, 18 August 2004 06:16:26 UTC

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