Set a checkbox based on values of other related checkboxes
Basically I'm looking for a master / slave type of behavior.
I have four checkboxes, cb0, cb1, cb2, and cb3. I'd like to check cb0 if ANY of the others are checked and uncheck cb0 if ALL of the others are unchecked. I would think there is a simple solution here as it should simply read somthing like:
var f0 = getField("cb0");
var f1 = getField("cb1");
var f2 = getField("cb2");
var f3 = getField("cb3");
if (f1.value === "On" || f2.value === "On" || f3.value === "On") {
f1.value = "On";
} else {
f1.value = "Off";
}
Many thanks in advance!
