Skip to main content
Known Participant
February 7, 2022
Answered

Making One Check Box Check Another

  • February 7, 2022
  • 1 reply
  • 2385 views

Hi There,

 

I have a Checkbox that activates a calculation in a Text field. I would like another Checkbox, multiple in fact, to activate the initial Checkbox. If any or all of the others are checked, it will check the box and activate the field.

 

I don't see a place to enter a script in a checkbox is my first problem.

 

Please advise.

 

Thansk!

~Marc

This topic has been closed for replies.
Correct answer Nesa Nurani

Hi Nesa,

I am trying to make one Check Box check multilpe Check Boxes now.

I'm using the following variation of the script, and have tried multiple formats, but nothing seems to work:

this.getField("Check Box"+"Check Box2"+"Check Box3"+"Check Box4"+"Check Box5"+"Check Box6"+"Check Box7").checkThisBox(0,event.target.value == "Off" ? false : true);

Hope you can help again.

Thanks!

 


Rename your first checkbox from "Check Box" to "Check Box1" other checkboxes  leave as they are and use this script:

for( var i=1; i<=7; i++)
this.getField("Check Box"+i).checkThisBox(0,event.target.value == "Off" ? false : true);

1 reply

Nesa Nurani
Inspiring
February 7, 2022

If all checkboxes need to be checked to check checkbox for calculation perhaps it would be better to use hidden text field and use 'custom calculation script'.

EDIT: if any check box will checked it you can use this in all checkboxes as 'Mouse UP' event under 'actions' tab:

this.getField("Checkbox").checkThisBox(0,true);

Change "Checkbox" to your actual checkbox name.

MBLogicAuthor
Known Participant
February 7, 2022

Hi Nesa,

What action should I select after choosing Mouse Up. I thought it would be Add a Javascript, but I can't write anything in the Actions field.

 

 

MBLogicAuthor
Known Participant
March 18, 2022

In that case use this script instead it will check/uncheck checkbox:

this.getField("Checkbox").checkThisBox(0,event.target.value == "Off" ? false : true);


Hi Nesa,

I am trying to make one Check Box check multilpe Check Boxes now.

I'm using the following variation of the script, and have tried multiple formats, but nothing seems to work:

this.getField("Check Box"+"Check Box2"+"Check Box3"+"Check Box4"+"Check Box5"+"Check Box6"+"Check Box7").checkThisBox(0,event.target.value == "Off" ? false : true);

Hope you can help again.

Thanks!