[whatwg] forms-lite testbed

Lachlan Hunt lachlan.hunt at lachy.id.au
Sat Oct 28 19:45:12 PDT 2006


Matthew Raymond wrote:
> Dave Raggett wrote:
>>   required (or needed)
>>     This is an expression like validate but requires the user
>>     to have filled out a value for the field. The library
>>     evaluates expressions by first rewriting them and then
>>     calling the JavaScript eval function.
> 
>    I don't see why required fields should have dependencies on other
> fields. A simple |required="required"| attribute should suffice.
> [...] There might be a use case here, but you have yet to present
> it.

Actually, conditionally required fields would be a very nice addition. 
I built this site earlier this year, which has conditionally required 
fields.

https://www.edentiti.com/create/details.jsf

See the Postal Address section.  It's required unless it's the same as 
the residential address.  If you check the "Use residential address" 
checkbox, the fields are no longer required.  If you uncheck it again, 
they are.  The JS updates the fields as soon as you check or uncheck the 
box.

-- 
Lachlan Hunt
http://lachy.id.au/



More information about the whatwg mailing list