advanced validation

Any tips and tricks that has to with the ADDT that doesn't fit into one of the other categories
antonio
Posts: 77
Joined: 2010-09-28 11:48

advanced validation

Post by antonio » 2011-12-05 15:57

Hi all,
still having problem with validation. sorry.
All I wanto to do seems easy:
I would like to throw an error if 5 fields are left to default.

Example:

field1: [0_______]
field2: [0_______]
field3: [0_______]
field4: [0_______]
field5: [0_______]
name: [_______]

this form should show an error if all field from field1 to field5 are equal to 0.
No error should be displayed if one or more of these field is different than 0.

Mathematically speacking (!): if the sum of field1+field2+field3+field4+field5 is 0 than display an error.
But is seems that validation trigger does't read expressions. Or perhaps I'm missing something.
Which is the correct format to use expression in validation trigger?

TIA for any helkp.

tony

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: advanced validation

Post by Fred » 2011-12-11 10:28

Use the "Throw Error"
You can have multiple conditions to check for before it throws the error.

You will also be able to use : {POST.field1}+{POST.field2} == '0' as the condition.

antonio
Posts: 77
Joined: 2010-09-28 11:48

Re: advanced validation

Post by antonio » 2011-12-15 09:56

Thanks Fred.
I really appreciate your help.

tony

Post Reply