validate field based on another field?

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

validate field based on another field?

Post by antonio » 2011-12-05 12:49

Hi all,
I have a custom transaction with few input fields.

I need to validate a field, based on another field.

Example:
Here is the form:
'quantity1' [__________________] - Category1(dropdown menu - static)
'quantity2' [__________________] - Category2(dropdown menu - static)

The field category should be required only if the quantity1 or quantity2 fields are greater than 0.

And at least 'quantity1' or 'quantity2' is required.

I'm trying to use the conditional options on the validation form wizard but it validate the whole form at once, thus non allowing me to validate the single field (category).

Is this possible with ADDT/Kollection 3?

It seems that custom triggers should be able to solve this, but I cannot find a sample to study.

TIA for any help.

tony

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

Re: validate field based on another field?

Post by antonio » 2011-12-05 13:19

Additional info:
I found an interakt tutorial that seems to do this but I'm not sure it working ok.

The tutorial says simply to add another validation form that will validate one filed based on another field.
Once I add this to the page I don't see anymore the asterisk for all required fields.
All required fields are still required but I have no feedback bout this in the page.
I don't get anymore the message under the fields that says 'this field is required'.
I only get the error message saying 'there is something wrong on your form'.

I'll try to recreate the page from scratch. Who knows? perhaps I messed up the code by hand...

HTH

tony

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

Re: validate field based on another field?

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

Use the "Throw Error" behaviour and under the advanced tab you can set your condition.

Post Reply