Skip to main content
Known Participant
March 20, 2018
Question

how to control 1 checkbox from another checkbox?

  • March 20, 2018
  • 1 reply
  • 711 views

i have 5 categories with 3 check boxes in each category.

[like: category 1: checkbox1, checkbox2, checkbox3

category 2: checkbox4, checkbox5, checkbox6

category 3: checkbox7, checkbox8, checkbox9

category 4: checkbox10, checkbox11, checkbox12

category 5: checkbox13, checkbox14, checkbox15 ]

now i want..

any 1 group items can be checked.

eg: if i select checkbox2 in category 1, then remaining 4 categories should be unchecked.

i must be select 1 or all checkboxes in 1 category (checkbox1,2,3 in cat1)

like: if checkbox1.checked = true then

checkbox4, checkbox5...checkbox15.checked = false

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
March 20, 2018

Put a script in the MouseUp Action of the Checkbox that controls the others.

Something like this:

if(event.target.isBoxChecked(0))

{// Check box is checked, turn off other check boxes

  this.getField("Checkbox4").checkThisBox(0,false);

  this.getField("Checkbox5").checkThisBox(0,false);

  etc for other checks that should be turned off

}

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often