Hello all, I am trying to use a dropdown field in a form to also check or uncheck various checkboxes based on value. I am trying something like the following:
f = this.getField(event.target.name).value;
g = this.getField("Checkbox1");
h = this.getField("Checkbox2");
if ( f == "Value1" )
g.value = true;
h.value = false;
g.value = false;
h.value = true;
and so on. This isn't working out the way I'd like. It's probably an easy syntax or terminology thing. Can anyone advise? Thanks!
The value of check-boxes is not true/false, but a string (either "Off" or the export value).
You can also set them like this, though:
this.getField("Checkbox1").checkThisBox(0, true); // to tick a box
this.getField("Checkbox2").checkThisBox(0, false); // to un-tick a box
Edit: fixed the code
Thanks, that did the trick!