Page 1 of 1

validate field based on another field?

Posted: 2011-12-05 12:49
by antonio
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

Re: validate field based on another field?

Posted: 2011-12-05 13:19
by antonio
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

Re: validate field based on another field?

Posted: 2011-12-11 10:24
by Fred
Use the "Throw Error" behaviour and under the advanced tab you can set your condition.