Skip to main content
Participant
April 23, 2020
Question

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

  • April 23, 2020
  • 1 reply
  • 240 views

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 has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 23, 2020

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);