I have a custom validation that is only evaluating part of the expression. It's attached to a choice control (dropdown)
If I chose
And a value from the second dropdown
The validation will be successful
If I chose
And a value from the second dropdown, the control will fail the validation regardless if a value is selected or not
Solved! Go to Solution.
1. javascript's '&&' operator has higher precedence over '||'.
so, 2nd and 3rd expressions are first ANDed and result then ORed with1st expression in your formula.
I feel you wanted first OR to be evaluated and then result ANDed to 3rd expression.
2. to check for control emptiness use rather isNullOrEmpty() runtime function
Hi Marian,
I have tried the following with the same results
And
you have reordered single expressions but you haven't changed evaluation logic at all.
your formula should look like (simplified)
isNullOrEmpty(SSMP) && (MEO == 'Family' || MEO == 'Adult')
note parentheses there to force OR evaluate before AND.
from logic point of view it doesn't matter whether you put && before or after parentheses.
this resolved the issue
is there a reference for the order of rules and logic?