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

Need checkbox to automatically check when others are checked

New Here ,
Aug 16, 2024 Aug 16, 2024

Copy link to clipboard

Copied

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

Views

113

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

It is something like that, AEM Designer, version 6.5

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

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
Enthusiast ,
Aug 17, 2024 Aug 17, 2024

Copy link to clipboard

Copied

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";

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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