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

Need script to show text if multiple dropdown selections match

New Here ,
Aug 10, 2024 Aug 10, 2024

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

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

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