W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2004

[whatwg] suggestion

From: Judah Frangipane <judahf@fmtcs.com>
Date: Tue, 08 Jun 2004 16:02:37 -0500
Message-ID: <40C6296D.4080102@fmtcs.com>
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')" />

Judah
Received on Tuesday, 8 June 2004 14:02:37 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:17 UTC