[html-formfu] fieldA OR fieldB Constraint

Benjamin Martin benjamin at opusvl.com
Tue Sep 8 12:22:45 GMT 2009


Excellent.

I thought it might be via the application of a Constraint, but I just 
could not see it

Thanks alot Carl, very much appreciated.



Carl Franks wrote:
> Hi Ben,
>
> The MinMaxFields constraint should do for this:
>
> constraint:
>   type: MinMaxFields
>   name: fieldA
>   others:
>     - fieldB
>   min: 1
>   max: 1
>
> This will ensure that at least one is filled in, but not both.
> If you want both to be optional, min(0) should work for that.
>
> Carl
>
> 2009/9/8 Benjamin Martin <benjamin at opusvl.com>:
>   
>> Hello,
>>
>> Have hunted about abit, but can't find a constraint that will allow me to
>> say "fill out fieldA OR fieldB" ... I'm guess there is something out there??
>> ... or do I need to roll my own??
>>
>> Many thanks,
>> -Ben
>>
>> _______________________________________________
>> HTML-FormFu mailing list
>> HTML-FormFu at lists.scsys.co.uk
>> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>>
>>     
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>
>   




More information about the HTML-FormFu mailing list