[html-formfu] Problem with constraint When

Mario Minati mario.minati at googlemail.com
Tue Sep 25 19:17:28 GMT 2007


On Tuesday 25 September 2007 13:28:00 Cosmin Budrica wrote:
> I can't trigger then constraint when it's supposed to, it always stays
> on the Required constraint.
>
> Here's the code:
> ---
> elements:
>  - type: Select
>    name: school_fk
>    label: University
>  - type: Text
>    name: school
>    constraints:
>      - type: Required
>        when:
>          - field: school_fk
>          - value: x
>
> the school_fk select is populated with a structure like:
> [ ['x', 'Other schools'], [1, 'University 1'], [...] ]
>
> What am I doing wrong?

It should be:
    constraints:
      - type: Required
        when:
            field: school_fk
            value: x

No minus in front of field and value.

Greets,
Mario



More information about the HTML-FormFu mailing list