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

Need script to show text if multiple dropdown selections match

New Here ,
Aug 10, 2024 Aug 10, 2024

Copy link to clipboard

Copied

Using Adobe Acrobat Pro - I am creating a form that has 6 different sections.  I have a dropdown field with the option to choose either PASS or FAIL in each section.  I looking for way to show a hidden text field only if the option PASS is selected in all 6 dropdown fields.  Is this possible?  Need help with javascript if so.  Thanks!

 

 

TOPICS
General troubleshooting , How to , JavaScript , PDF forms

Views

107

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 , Aug 10, 2024 Aug 10, 2024

Let's say your dropdown fields are named "Dropdown1" to "Dropdown6", as custom calculation script of text field you wish to show/hide use this:

var count = 0;
for(var i=1; i<=6; i++){
var f = this.getField("Dropdown"+i).valueAsString;
if(f === "PASS")count++;}

event.target.display = (count == 6) ? display.visible : display.hidden;

Votes

Translate

Translate
Community Expert ,
Aug 10, 2024 Aug 10, 2024

Copy link to clipboard

Copied

Let's say your dropdown fields are named "Dropdown1" to "Dropdown6", as custom calculation script of text field you wish to show/hide use this:

var count = 0;
for(var i=1; i<=6; i++){
var f = this.getField("Dropdown"+i).valueAsString;
if(f === "PASS")count++;}

event.target.display = (count == 6) ? display.visible : display.hidden;

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 11, 2024 Aug 11, 2024

Copy link to clipboard

Copied

LATEST

That worked perfectly!  Thank you so much for your help!  I have been reading through threads all day trying to find something that would work, with no luck.  I've seen your helpful replies on so many of these and was secretly hoping you would reply to mine lol!  Again, thank you so so so much for the help!  Truly appreciate it!

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