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

Dropdown list - Add Items

Community Beginner ,
Aug 10, 2021 Aug 10, 2021

Hi there,
I have the Adobe Acrobat DC, and I am creating a dropdown list. However, it is only allowing me to add a maximum of 14 items and no more. The form I am working on it requires more than that 14 items. How can I add the additional items? Any assistance is much appreciated 🙂

TOPICS
PDF forms
1.8K
Translate
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 ,
Aug 10, 2021 Aug 10, 2021

I just tried this with my version of Acrobat (which is the latest), and I can definitely add more than 14 items (I stopped at 20). So it is not a restriction of Acrobat.

 

You can always add the items for a dropdown list programatically, which I prefer when I have long lists anyway - it cuts down on the clicking and typing, and also reduces the potential for mistakes. You do this with JavaScript by using the Field.setItems() method: https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%...

 

Translate
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 ,
Aug 10, 2021 Aug 10, 2021

Hi Karl, thanks for your reply.

Umm, that is interesting... Maybe something is wrong with my program... is my version the same as yours?

UK_Will_0-1628610235257.png

Also thank you very much  for sending the link for the guidance, I appreciated, however, I have  zero knowledge on JavaScrip...  and was not able to understand the guidance. 

Translate
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 ,
Aug 10, 2021 Aug 10, 2021

I have the same version number, but I run "Pro" and not "Standard" (and on a Mac). Unfortunately, I don't have access to Standard, so I cannot test to see if that behaves differently than my Pro version. I understand, that to make sense out of that page from the API documentation, you do need some background in JavaScript. If you can manage to add a button to your document, and use the following as a JavaScript that gets run on a "Mouse Up" event, you can add items programatically. You would then remove the button after you've added the items. With Acrobat Pro, you have access to the JavaScript console, which I think is not available in Acrobat Standard, but I might be wrong: Try Ctrl-J to see if the console pops up. If that's the case, you should be able to run the script in the console:

 

this.getField("Dropdown").setItems(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" ]);

Change the name of the field (which is set to "Dropdown") to whatever your field name is, and then replace the "1" and so on with the string you want to display. Make sure that the basic syntax stays the same, otherwise Acrobat will complain about syntax problems. Here is some additonal information about the JavaScript console: https://acrobatusers.com/tutorials/javascript_console/ and here is some old information about how to add a button action (the user interface has changed since then, but the basic idea is the same): https://answers.acrobatusers.com/How-add-JavaScript-mouse-action-Submit-button-q28915.aspx 

Translate
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 ,
Aug 10, 2021 Aug 10, 2021

Hi Karl,

Thanks for your quick and prompt response!

No worries about the version. However your, explanation, was easy and clear. I also did a tube search on what you told me , about the java and I saw a video , which did show the add button version, that you mentioned.  In the end I managed to do and worked!  My version dont support the Ctrl-J JavaScript console, but I was able to do what I needed. Now with the links you provide I now improved my knowledge of Java Script... I probably know about  1% of the program 🙂 LOL . I also restarted the program once again and is now enabling me to add more than 14 items... So stranger , probalby was a glitch... I appreciated all your time and support on the matter, I would not make it without your help! Cheers! 

Translate
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 ,
Aug 10, 2021 Aug 10, 2021

What happens when you add more items?

Translate
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 ,
Aug 10, 2021 Aug 10, 2021
LATEST

Hi Bernd, 

Thank you for offering your help, I had the program restarted and is now allowing me to add more items.... very strange... But anyway, just want to say  Thanks for your time. 

Translate
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