Skip to main content
Participant
Apr 23, 2020 2:13 AM UTC
Question

How to have 3 checkboxes when checked, check a fourth text box

I need the javascript code that would allow me to have a check box (box1) to be automatically checked, when three check boxes (box2, box3, box4) are all checked. If one of the three check boxes are unchecked, then check box (box1) becomes unchecked as well.

 

Also, check box1 cannot be unchecked or checked manually. 

 

Hopefully that makes sense.

 

Thanks,

 

Dave

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

try67
Community Expert
Community Expert
Apr 23, 2020 10:21 AM UTC

Create a (hidden) text field with the following custom calculation script:

 

var a = this.getField("box2").valueAsString!="Off";
var b = this.getField("box3").valueAsString!="Off";
var c = this.getField("box4").valueAsString!="Off";
this.getField("box1").checkThisBox(0, a && b && c);
Translate