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

How to hide one checkbox in a group

New Here ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Hello there ! 

I am trying to do something which seems quite simple, but I can't manage to make it work. 

I have two independant sets of checkboxes and when one of the checkbox in the first set is checked, it makes one of the checkbox in the second set visible. 

 

Here is the script I have at the moment and which works, but hides all the second set of checkboxes : 

var nHide = (event.target.value=="CB1")?display.visible:display.hidden; 

this.getField("CB2").display = nHide; 

 

I am looking for a way to hide only one of the checkboxes in the second set (and unfortunately, I can not use separate names for the second set of checkboxes). 

 

Thank you for your help.  

TOPICS
Acrobat SDK and JavaScript

Views

52

Likes

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

correct answers 1 Correct answer

Community Expert , Jun 21, 2021 Jun 21, 2021

To do that you have to access the individual widget in the group, like this:

 

this.getField("CB2.0").display = nHide;

 

The number is the index number of that widget in the group, starting with zero.

Likes

Translate

Translate
Community Expert ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

To do that you have to access the individual widget in the group, like this:

 

this.getField("CB2.0").display = nHide;

 

The number is the index number of that widget in the group, starting with zero.

Likes

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 ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

LATEST

Thanks a lot, It works ! 

A huge massive thank you for your help. 

Likes

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