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

Drop down lists

Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

I want to use a drop down list on a form. The list could have many entries. So far the only way I have found to populate the list is the one at a time entry in Properties. Painful. Is there an easier way  to do this?

 

TOPICS
PDF forms

Views

724

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

correct answers 1 Correct answer

Community Expert , Jan 30, 2021 Jan 30, 2021

You can put this code in a button as Mouse UP event, and then when clicked it will populate dropdown field with choices.
Add more choices as sees fit.
If you don't need export values, remove that part from code.

this.getField("Dropdown1").setItems([["Option1", "Export value1"], ["Option2", "Export value2"]]);

 

Votes

Translate

Translate
Community Expert ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

You can set the items with a Javascript script.

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 ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

You can put this code in a button as Mouse UP event, and then when clicked it will populate dropdown field with choices.
Add more choices as sees fit.
If you don't need export values, remove that part from code.

this.getField("Dropdown1").setItems([["Option1", "Export value1"], ["Option2", "Export value2"]]);

 

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
Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

I see. The "setItems" is what I was looking for. Thank You.

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
Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

Can I push the envelope a bit, is there something like "addItem"?

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 ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

You can use the method "insertItemAt"

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
Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

LATEST

That worked. Thank you.

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 ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

If you have the list of items in a text file you can use a script to read the contents of that file directly and then import them into the drop-down field.

 

I've developed a (paid-for) script that does just that. You can find it here: https://www.try67.com/tool/acrobat-import-items-from-a-text-file-to-a-combo-box-or-list-field

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