[whatwg] suggestion

Judah Frangipane judahf at fmtcs.com
Tue Jun 8 14:02:37 PDT 2004

I like this specification. I think it is necessary.

I would like to add a suggested feature to the required field attribute. 
There are situations where I have a input element or checkbox on a form 
that has sub form elements that should be required if the first input 
element is filled out or contains a certain value. For example, let's 
say I have a fieldset containing form elements in a form that is for 
singles and there is a fieldset containing form elements for married 
couples. I have a radio group above that that asks for marital status. 
If they select single then the single fieldset elements should be 
required; if they select married then the form elements in the married 
fieldset should be required.

I was thinking of some sort of expression for the required field such as:

<input type="text" name="spouses_name" required="if(maritalstatus.value=='married')" />


More information about the whatwg mailing list