Custom validation script with checkbox rules
Hey guys, I have been learning quite a bit by asking my javascript questions here and listening to your responses. I really appreciate all the help I have gotten so far! I am at it yet again though, and now I would like to expand my current validation script to add a condition.
I have a text box that is a calculated % derived from some other boxes, and I have it changing colors based off the value. The twist is that I would like it to use one value if a certain checkbox is checked, and a different value if a different checkbox is checked.
The current validation script I am using is:
var v = event.value;
if (v>.7649) {event.target.fillColor = color.green;}
if (v<.7650) {event.target.fillColor = color.red;}
How would I modify this so that it also checks to see if a checkbox is checked as a condition? and is it possible to do like an "else" statement to use a different value if that checkbox is NOT checked, or if a DIFFERENT checkbox is checked? either way...
FYI the checkboxes are all named the same (Checkbox1), but the output values are different so that way only one can be checked at any given time.
Thank you again for all your help and support!
