Drop down lists

New Here ,
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

148

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

correct answers 1 Correct Answer

Adobe Community Professional , 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"]]);

Likes

Translate

Translate
Adobe Community Professional ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

You can set the items with a Javascript script.

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 ,
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"]]);

 

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

You can use the method "insertItemAt"

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

Copy link to clipboard

Copied

LATEST

That worked. Thank you.

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
Most Valuable Participant ,
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

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