• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Master Dropdown Listing

Community Beginner ,
Jun 21, 2024 Jun 21, 2024

Copy link to clipboard

Copied

I have a form that has the same dropdown list on every line (over 50 of them). If I need to change an item in the list, my only option is to edit each list on every single line. Changes happen frequently. Is there really no way to have one field/list that can be the source of my dropdown lists?

TOPICS
PDF forms

Views

118

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
Community Expert ,
Jun 21, 2024 Jun 21, 2024

Copy link to clipboard

Copied

You can put list as document level JavaScript that will populate all fields.

Votes

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
Community Expert ,
Jun 21, 2024 Jun 21, 2024

Copy link to clipboard

Copied

Just be aware it will reset the current selection each time it runs, so you would need to save that value first and then re-apply it later on.

Votes

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
Community Expert ,
Jun 21, 2024 Jun 21, 2024

Copy link to clipboard

Copied

Sure you can. I would do it using a (hidden) button somewhere in the vicinity of the "master" list. Say that list is called "Dropdown1" and the others are "Dropdown2" to "Dropdown50". Add a button with this code next to the first field:

 

var f = this.getField("Dropdown1");
var items = [];
for (var i=0; i<f.numItems; i++) {
	items.push(f.getItemAt(i));
}
for (var i=2; i<=50; i++) {
	this.getField("Dropdown"+i).setItems(items);
}

Update the first field's items, then click the button to update the rest of them.

Just be aware that updating the lists will clear any selections you made in any of these fields.

Votes

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
Community Beginner ,
Jun 26, 2024 Jun 26, 2024

Copy link to clipboard

Copied

LATEST

This seems to be working, but it is only copying to Dropdown2. Is something missing to get it to continue to copy to 3-50? I have copied and pasted the script exactly with no changes. 

Votes

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