Skip to main content
Participant
August 16, 2024
Answered

Need checkbox to automatically check when others are checked

  • August 16, 2024
  • 2 replies
  • 1115 views

I need "Solid Organ Transplant Services" (which is Row112.CheckBox26) to automatically check when any of the check boxes below it are selected.  I don't know javascript (at all), but I'm thinking it will need to be entered as a mouseUp script for each of the sub-checkboxes?  I tried the below script that I found in this community in the "Islet cells" box and it did not work.  This is probably something very easy but I don't have the foundational knowledge to figure it out. Thank you for your help. 

 

if(event.target.isBoxChecked(0)){
this.getField("Row112.CheckBox26").checkThisBox(0,true);}
else
this.getField("Row112.CheckBox26").checkThisBox(0, false);}

 

 

This topic has been closed for replies.
Correct answer try67

Questions about Adobe AEM/LiveCycle should be asked here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/ct-p/adobe-experience-manager-community

2 replies

PDF Automation Station
Community Expert
Community Expert
August 17, 2024

Create a hidden text fiel and enter the following as a custom calculation script:

 

var count=0;
var flds=
[
"Islet cells",
"Heart",
etc.
];

for(var i=0;i<flds.length;i++)
{
if(this.getField(flds[i]).value!="Off")
{count++;break;}
}

count>0?this.getField("Row112.CheckBox26").value="Yes":this.getField("Row112.CheckBox26").value="Off";

Nesa Nurani
Community Expert
Community Expert
August 17, 2024

You should check that value of checkbox is != "Off" or use 'isBoxChecked()' just to be sure if export value is not "Yes", and to check the checkbox use 'checkThisBox()' for same reason.

try67
Community Expert
Community Expert
August 16, 2024

Is this an Acrobat PDF form? Looks more like LiveCycle Designer (AEM), or something like that...

Participant
August 19, 2024

It is something like that, AEM Designer, version 6.5

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 19, 2024