Copy link to clipboard
Copied
Sorry new to Java Script and hoping someone can help me. I have three specific check boxes if any one or combination of those three boxes are check I want textfield1 to have a black background. If all text boxes are unchecked I want textfield2 to have a black backgound. Currently the background colors for both of those fields are set to none.
Copy link to clipboard
Copied
You can try with a custom calculation script.
In the example below, I've placed the custom script in "textfield1":
var field1 = event.target;
var field2 = this.getField("textfield2");
var cb1 = this.getField("Check Box1").value;
var cb2 = this.getField("Check Box2").value;
var cb3 = this.getField("Check Box3").value;
field1.fillColor = (cb1 !=="Off" || cb2 !=="Off" || cb3 !=="Off") ? color.black : color.transparent;
field2.fillColor = (cb1 =="Off" && cb2 =="Off" && cb3 =="Off") ? color.black : color.transparent;