Re: [whatwg] Checkboxes that control other checkboxes

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  
<https://addons.opera.com/en/extensions/details/gmail-compose/?display=en>  
(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.

-- 
Michael

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