[whatwg] New suggestion for mutually exclusive sections in WF2
dolphinling at myrealbox.com
Sun Oct 17 14:27:26 PDT 2004
Actually, this suggestion has slightly more scope than just mutually
exclusive sections, you'll see how in a moment.
This suggestion is for an attribute, which I shall call qwe since I
can't come up with a good name, which can be applied to a fieldset.
This attribute is similar to the form attribute--it's value must be the
value of the id of an input of type checkbox or radio which the
fieldset is associated with.
If that checkbox or radio button is checked, the fieldset is not
disabled. If the checkbox or radio button is not checked, the fieldset
<input type='radio' name='dessert' value='icecream' id='i'>
<label for='i'>Vanilla ice cream</label>
<input type='checkbox' name='topping' value='chocsause' id='i1'>
<label for='i1'>Chocolate sauce</label>
<input type='checkbox' name='topping' value='carmsause' id='i2'>
<label for='i2'>Caramel sauce</label>
<input type='checkbox' name='topping' value='mcherry' id='i3'>
<label for='i3'>Maraschino cherry</label>
<input type='radio' name='dessert' value='cake' id='c'>
<label for='c'>Chocolate cake</label>
<input type='radio' name='icing' value='mint' id='c1'>
<label for='c1'>Mint icing</label>
<input type='radio' name='icing' value='vanilla' id='c2'>
<label for='c2'>Vanilla icing</label>
This would present the user with a choice of ice cream or cake, and a
choice of toppings for their ice cream or icing flavors for their cake.
The other, non-mutually-exclusive-sections way this attribute could be
used is with a single checkbox, as in:
<input type='checkbox' name='moreinfo' value='moreinfo' id='mi'>
<label for='mi'>Send me more info</label>
<input type='email' name='email' id='email'>
<input type='checkbox' name='like' value='basketball' id='bb1'>
<input type='checkbox' name='like' value='baseball' id='bb2'>
If the user checks the box labeled "Send me more info", they're
presented with a place to input their email and choices on what info to
It would be good to also have a way to make these stylable based on
whether or not they're disabled. I'm not sure exactly how to do this.
 Yes, only a fieldset and not an input. I don't have a good, solid
reasoning for this, it just seems like the right thing to do.
 Only checkboxes and radio buttons. Other input types might be
possible to implement like text (if there's anything in there, the
related fieldset becomes not disabled) or email (if there's a valid
email addres), but their use cases don't make sense.
More information about the whatwg