Re: Form element dependencies

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