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

How to export all values in the listbox (or better drop-down list)?

Participant ,
Jul 25, 2023 Jul 25, 2023

Hi,

I need your help, please. I have attached a file for better understanding.

I have two lists: "Countries List" and "Selected Countries List." Users can add countries from the drop-down list to "Selected Countries List" to keep track of all the countries they have visited. However, when exporting the file, it only exports the selected values in the "Selected Countries List." I want to get all the countries that are in the "Selected Countries List" without having to select them one by one.

Can you please assist me with this?

Thank you!

TOPICS
Create PDFs , JavaScript , PDF , PDF forms
757
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 ,
Jul 25, 2023 Jul 25, 2023

What are you using to export the file?

Field data exports do not include list items, because they are not data, at least not in the traditional sense. If you want these items exported, then you'll need to add them to a text field. This could be a hidden text field. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Participant ,
Jul 26, 2023 Jul 26, 2023

Thanks Thom,
I included a button to export to XFDF. I got what you mean, sorry to say but how to do so please?

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 ,
Jul 26, 2023 Jul 26, 2023
LATEST

Add a text field to the form, set it's visibility property to  hidden. Then add code to the button that does the export to collect all the items in the list field into a CR/LF separated string and put that into the hidden field. Now all the seleted countries will be in the export data. 

 

BTW: the export code seems a little complex. There isn't any reason to collect all the fields. Acrobat will automatically export everything that isn't a button. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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