Copy link to clipboard
Copied
I am developing a form that has multiple fields (50+) of the same type of data, but each will have different values. I would like to use dropdown menus for each one, but entering the code in each field would be cumbersome.
Is it possible to set each field to draw the menu data from a single source?
Copy link to clipboard
Copied
Hi there
Hope you are doing well and thank you for reaching out.
The workflow that you are trying to achieve is might be possible using JavaScript. For more information please check the help page https://acrobatusers.com/tutorials/javascript_console/
Hope it will help
Regards
Amal
Copy link to clipboard
Copied
Yes, it is possible, using a script. The source could either be an attached (text) file or the values could be hard-coded into the script. The former is easier to edit, but more difficult to set up. The latter is easier to set up but more difficult to edit.
The basic code would be something like this:
var items = ["Select an item", "Item 1", "Item 2", "Item 3"];
this.getField("Dropdown1").setItems(items);
this.getField("Dropdown2").setItems(items);
this.getField("Dropdown3").setItems(items);
Note that each time you run it, though, the selected value will be lost and the field will revert to the default value, which is the first one in the array.
I've developed a (paid-for) tool that allows you to do quite easily, though. You can find it here:
https://www.try67.com/tool/acrobat-import-items-from-a-text-file-to-a-combo-box-or-list-field