Copy link to clipboard
Copied
Hi all,
I am trying to create a form that allows our customers to view different styles of each of our items. I am working in Adobe Acrobat on a Mac. Under each item, is a drop-down 1 which runs custom validation script to populate drop-down 2 which runs custom validation script to either show or hide an image of the chosen finish below using a button (image is used as the button icon).
So for instance, if they choose Door Style 29, in drop-down 1 they select the type of species they would like to use. From there they are given color options in drop-down 2. Once they choose a color in drop-down 2, and image appears below. This is pictured below:

Here is what my script looks like:
Script for drop-down 1 (Style29):
switch (event.value) {
case "Eurolaminate":
this.getField("Sub29").setItems(["Alpine Oak","Barn Pine"]);
break;
case "-":
this.getField("Sub29").setItems(["-"]);
break;
}
Script for drop-down 2 (Sub29):
this.getField("Alpine Oak").display = event.value=="Alpine Oak" ? display.visible : display.hidden;
And so on for each additional item
My script works fine when I preview it in Adobe Acrobat. As soon as I save the file however, the drop-downs no longer work as they are supposed to and the color image never appears. This is the case in both Preview and Adobe Acrobat. I have also tried saving it as "Reader Extended PDF >> Enable More Tools". How can I save the file so that it works as it does when previewing it?
Copy link to clipboard
Copied
Don’t expect forms to work in Preview. Don’t use it at all! It is notorious not only for limited support but for delivering corrupt forms. You must give you customers very clear instructions to use only Adobe products, and not to expect this to work on their tablet or phone.
You say “script for <field>“ but there is a world of difference between the different actions. What is good in calculate may be disastrous in validate, and so on. What specific script is it?
Copy link to clipboard
Copied
I am using validate
Copy link to clipboard
Copied
You are doing too much for a validate script. If the validate script does more than validate, it needs to be something else. Generally if you want a DIFFERENT field to change, you set the calculate script of the other field.
Copy link to clipboard
Copied
That's helpful. I moved the script from Drop-Down 2 to calculate instead of validate. Now the script for drop-down 1 is working correctly after I save. However, the script for drop-down 2 (to hide or unhide the image (button) of the item selected in drop-down 2) still isn't working. Any suggestions as to how I should proceed?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more