Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need checkbox to automatically check when others are checked

New Here ,
Aug 16, 2024 Aug 16, 2024

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

 

 

Capture5.PNG

TOPICS
How to , JavaScript , PDF forms
843
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Aug 19, 2024 Aug 19, 2024
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2024 Aug 16, 2024

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 19, 2024 Aug 19, 2024

It is something like that, AEM Designer, version 6.5

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2024 Aug 19, 2024
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2024 Aug 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";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2024 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines