Skip to main content
Participating Frequently
December 19, 2016
Question

Multiple Combo-boxes Reference one List

  • December 19, 2016
  • 1 reply
  • 613 views

Hello All,

I am in the process of developing a pdf form that will contain approximately 30 combo-boxes of employees names. I am looking to have all 30 combo-boxes reference one listing for their values as the list may be frequently updated and I do not want to have to update each of the 30 combo boxes every time a change needs to me made to the employee listing. I am looking for some input on how I can accomplish this easily. My thought was javascript or something may work. Thanks in advance for your help!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 19, 2016

There are several ways you can do it.

One is to place the data in a (hidden) text field and use a script to read it, analyze it and then use it for the drop-downs.

Another, more complex option, is to use an attached text file to do the same.

jmcramboAuthor
Participating Frequently
December 19, 2016

Would you happen to have any guidance or sample code on how to do this? This will be my first attempt at something like this so the simplest option would probably be the best. Thanks!

try67
Community Expert
Community Expert
December 19, 2016

This is not a very simple task for a beginner, but the basic code to do it using a text field would be something like this (let's say it's a multiline text field called "Items", with each line being a separate item, and the drop-downs are called "Selection1", "Selection2"... "Selection10"):

var items = this.getField("Items").valueAsString.split("\r");

for (var i=1; i<=10; i++) {

     this.getField("Selection"+i).setItems(items);

}