Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Single data source for multiple menus

New Here ,
Sep 13, 2021 Sep 13, 2021

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?

TOPICS
Create PDFs, JavaScript, PDF forms

Views

25

Likes

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
Adobe Employee ,
Sep 13, 2021 Sep 13, 2021

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

Likes

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
Adobe Community Professional ,
Sep 13, 2021 Sep 13, 2021

Copy link to clipboard

Copied

LATEST

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

Likes

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