W3C home > Mailing lists > Public > public-html@w3.org > March 2015

Re: Form element dependencies

From: Cameron Jones <cmhjones@gmail.com>
Date: Tue, 17 Mar 2015 13:26:07 +0000
Message-ID: <CALGrgeum4Vr73iLP-qbMYaNysdYn0KHZSVK81GCakC2Ne9UuNA@mail.gmail.com>
To: sisbluesteel <sisbluesteel@aol.com>
Cc: "public-html@w3.org LIST" <public-html@w3.org>
On Fri, Mar 13, 2015 at 9:41 PM, sisbluesteel <sisbluesteel@aol.com> wrote:
> So,
>
>  As a summary: In it's simplest, form dependencies, or form control state
> management would be utilised as follows:
>
> <input type="radio" for="dependant_text />
> <input type="radio" for="dependant_fieldset_a" />
> <input type="checkbox" for="dependant_fieldset_b" />
> <select>
>
>     <option>1</option>
>     <option for="dependant_date">2</option>
>     <option>3</option>
>
> </select>
>
> <input type="text" id="dependant_text" />
> <input type="date" id="dependant_date" />
>
> <fieldset id="dependant_fieldset_a">
>
>     <label>Text:</label><input type="text"  />
>     <label>Number:</label><input type="number" />
>
> </fieldset>
>
> <fieldset id="dependant_fieldset_b">
>
>     <label>Options:</label><select>
>         <option>a</option>
>         <option>b</option>
>     </select>
>
> </fieldset>
>
> Where the @for attribute controls the target element's availability
> (Triggering @disabled attribute). Hiding disabled control can be done using
> CSS as usual and doesn't require any added functionality(
> '.some-element:disabled { display: none }' ).
>
> Only new functionality added are: Allowing the @for attribute for input- (
> Of type: radio, checkbox) and option -controls and setting the target's (
> input, select, fieldset) @disabled attribute on/off when the states change.
>
>

If we consider the directionality of the @for attribute as used by
<label> and <output> then the association should be declared on the
'using' field/set and not on the state-giving input/option, ie:

<input id="optional" type="checkbox" />

<fieldset for="optional">
    ...
</fieldset>

Cameron
Received on Tuesday, 17 March 2015 13:26:35 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:12 UTC