Validate logic

Validate logic


Hi,

I'm trying to validate a field based on a selection in another field.  Is this possible?

I'm trying to say - if Return is Yes, than you have to enter something in Return_Reason.

I've tried the following, but it does not show an alert message after submitting.

On Form Actions>On Add>Validate

if (input.Return  ==  "Yes")
{
    if (input.Return_Reason  ==  "")
    {
        alert "Enter a Return Reason";
        cancel submit;
    }
}


Thanks so much for your help!