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

Show/hide certain check boxes based on drop down selection

Community Beginner ,
Mar 28, 2023 Mar 28, 2023

Hello, I need help with making certain check boxes visible/hidden based on a drop down selection. As you can see from the screenshot, I only want the check boxes on the side to be visible to mark off if I choose a value in the Account Type field since not all check boxes will be needed. Please help! this is the last thing I need to complete this form 🙂

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF forms
1.7K
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 ,
Mar 29, 2023 Mar 29, 2023

There was an error in a script I posted, it's fixed now.

You can add another choice like this:

if(event.value == "Choice1"){
this.getField("Checkbox1").display = display.visible;
this.getField("Checkbox2").display = display.visible;
this.getField("Checkbox3").display = display.visible;
this.getField("Checkbox4").display = display.hidden;
this.getField("Checkbox5").display = display.hidden;}

else if(event.value == "Choice2"){
this.getField("Checkbox1").display = display.visible;
this.getField("Checkbox2").display = display.visible;
this.getField("Checkbox3").display = display.hidden;
this.getField("Checkbox4").display = display.hidden;
this.getField("Checkbox5").display = display.hidden;}

 

 

View solution in original post

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 ,
Mar 28, 2023 Mar 28, 2023

You can use 'display' property and set checkboxes to 'visible' or hidden' depending on dropdown choices, something like this:

if(event.value == "Choice1"){
this.getField("Checkbox1").display = display.visible;
this.getField("Checkbox2").display = display.visible;
this.getField("Checkbox3").display = display.visible;
this.getField("Checkbox4").display = display.hidden;
this.getField("Checkbox5").display = display.hidden;}

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 Beginner ,
Mar 29, 2023 Mar 29, 2023

Thank you Nesa! How would I go on with the other choices? My issue now is that the other selections from the drop down is no longer generating nor will it let me select the other choices from the list. It seems like it's stuck. Can you show me an example of adding Choice2 as well? Just to make sure, this script should be in the custom calcuation script, correct?

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 ,
Mar 29, 2023 Mar 29, 2023

There was an error in a script I posted, it's fixed now.

You can add another choice like this:

if(event.value == "Choice1"){
this.getField("Checkbox1").display = display.visible;
this.getField("Checkbox2").display = display.visible;
this.getField("Checkbox3").display = display.visible;
this.getField("Checkbox4").display = display.hidden;
this.getField("Checkbox5").display = display.hidden;}

else if(event.value == "Choice2"){
this.getField("Checkbox1").display = display.visible;
this.getField("Checkbox2").display = display.visible;
this.getField("Checkbox3").display = display.hidden;
this.getField("Checkbox4").display = display.hidden;
this.getField("Checkbox5").display = display.hidden;}

 

 

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 Beginner ,
Mar 29, 2023 Mar 29, 2023
LATEST

You're the best, Nesa. Thanks a million!

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