W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] Checkboxes that control other checkboxes

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Fri, 23 Nov 2012 09:33:06 -0500
To: "Timo Beermann" <timo.beermann@googlemail.com>, "Ian Hickson" <ian@hixie.ch>
Message-ID: <op.wn8ddgai1ejg13@vertiform346>
Cc: whatwg@whatwg.org
On Wed, 21 Nov 2012 19:51:39 -0500, Ian Hickson <ian@hixie.ch> wrote:

> On Sun, 14 Aug 2011, Timo Beermann wrote:
>> It should be able to implemet checkboxes, where by only
>> activating/deactivating this single checkbox you can active/deactivate
>> multiple other checkboxes. That is possible with scripting today, but it
>> should be possible without scripting, only with HTML/CSS. Because some
>> users deactivate Scripting (for security or whatever other reason) and
>> on other computers (school, university, work,...) you are not able to
>> change the settings, even if you want to. E.g. I use NoScript and only
>> allow scripting on very few trusted sites, that really need it.
> I haven't added this yet, but it is already logged as a possible future
> extension, so it's possible it may be added in the future.
> What would be helpful though is examples of sites that do this kind of
> thing, so that we can study how necessary it is, and how to implement it.
> For instance, are the dependent fields always in a <fieldset>? Are they
> always other checkboxes? Is there more complex logic than just "check box
> A is checked so those controls are enabled"?

My non-web use-case is with  
(options.html in the unzipped package). I *disable* a checkbox when  
another checkbox is checked. I just use addEventListener('input') and  
check for e.target.checked to decide what to do.

However, it'd be cool if there were @disables and @enables for checkboxes  
(at least) where you can specify a list of controls (that match @name I  
guess). Those controls would still fire 'input' and 'change'.

In my case, since I'm already using JS, it's no biggie, but it'd still be  
cool to do that part without JS.

Received on Friday, 23 November 2012 17:41:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:48 UTC