Skip to main content
Known Participant
August 15, 2025
Answered

Check third checkbox if two other checkboxes are checked

  • August 15, 2025
  • 1 reply
  • 300 views

I have three checkboxes - CB1, CB2 and CB3.  If both CB1 and CB2 are checked, I would like CB3 to be checked.  CB3 would remain unchecked if either CB1 or CB2 were unchecked, or if both CB1 and CB2 were unchecked.  Thanks.

Correct answer try67

Create a (hidden) text field and place this code as its custom calculation script:

 

this.getField("CB3").checkThisBox(0, this.getField("CB1").valueAsString!="Off" && this.getField("CB2").valueAsString!="Off");

1 reply

try67
Community Expert
Community Expert
August 16, 2025

Do you want the value of CB3 to be determined only by the state of CB1 and CB2, or should the user be able to tick/untick it if they wanted to?

Known Participant
August 16, 2025

The value of CB3 should be determined only by the state of CB1 and CB2.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 16, 2025

Create a (hidden) text field and place this code as its custom calculation script:

 

this.getField("CB3").checkThisBox(0, this.getField("CB1").valueAsString!="Off" && this.getField("CB2").valueAsString!="Off");