[html-formfu] fieldA OR fieldB Constraint

Carl Franks fireartist at gmail.com
Tue Sep 8 11:53:57 GMT 2009


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
>



More information about the HTML-FormFu mailing list