Skip to main content
Participating Frequently
October 16, 2024
Answered

I need help making an item list for multiple drop down fields to use

  • October 16, 2024
  • 3 replies
  • 852 views

I have a form that uses first and last name to populate for training. I need to be able to make one item list for all the names that multiple lines can use. I wish to be able to update one list and have that update for all fields to use rather than update the first then change field names to match the first then change back . Any ideas?

This topic has been closed for replies.
Correct answer try67

Do you mean like a "master" field where you could update it and then copy those updates to the rest of the fields?

If so, you can do it using this code (you can run it from the JS Console or a button):

 

var items = [];
var masterField = this.getField("LastNameMaster");
for (var i=0; i<masterField.numItems; i++) {
	items.push([masterField.getItemAt(i, false), masterField.getItemAt(i, true)]);
}
for (var i=1; i<=26; i++) {
	this.getField("LastName"+i).setItems(items);
}

3 replies

PDF Automation Station
Adobe Expert
October 17, 2024

I created a (paid for) custom tool that lets you easily fill dropdowns with display values and export values by copy and pasting a column(s) from Excel if you're interested:

https://www.pdfautomationstation.com/products/item16.cfm

 

try67
try67Correct answer
Adobe Expert
October 16, 2024

Do you mean like a "master" field where you could update it and then copy those updates to the rest of the fields?

If so, you can do it using this code (you can run it from the JS Console or a button):

 

var items = [];
var masterField = this.getField("LastNameMaster");
for (var i=0; i<masterField.numItems; i++) {
	items.push([masterField.getItemAt(i, false), masterField.getItemAt(i, true)]);
}
for (var i=1; i<=26; i++) {
	this.getField("LastName"+i).setItems(items);
}
IgnitrosAuthor
Participating Frequently
October 20, 2024

I'm sorry. I just figured out how to implement what you suggested. I was confused because when I run the script it fills in every field from 1-26 after running it. I just have to delete the fields out but the item list does in fact update.

 

Thank you for putting up with my lack of knowledge on this. I really appreciate the help.