Skip to main content
boilermaker73
Inspiring
February 9, 2022
Resuelto

Add export values to each item provided in an item list serving a drop down using javascript

  • February 9, 2022
  • 1 respuesta
  • 1662 visualizaciones

While I can easily enough populate a drop down list by creating a script using the setItems method to assign the values of an array to populate the items in a drop down list, is there a also property or method I can use to add/populate the export values for each and every item as well from inside my script? 

Este tema ha sido cerrado para respuestas.
Mejor respuesta de boilermaker73

Resolved. Fortunately, I found an answer posted by Try67 back in January 2022. The solution is based on using a 2-dimensional array. Whoever would have thought? Though somewhat intuitive, I never would have guessed that creating a 2-dimensional aray with a 2nd element assigns an export value to each item in a drop down list. And here I always believed that the setItems method was solely intended to access/asign items to the drop down list. My final question was where in the tutorials provided by Adobe such as the Adobe Acrobat Javascript reference can this information be found? Under the setItems () method, I guess I should have read the fine print displayed to the right of the oarray parameter. Duh?

1 respuesta

boilermaker73
boilermaker73AutorRespuesta
Inspiring
February 9, 2022

Resolved. Fortunately, I found an answer posted by Try67 back in January 2022. The solution is based on using a 2-dimensional array. Whoever would have thought? Though somewhat intuitive, I never would have guessed that creating a 2-dimensional aray with a 2nd element assigns an export value to each item in a drop down list. And here I always believed that the setItems method was solely intended to access/asign items to the drop down list. My final question was where in the tutorials provided by Adobe such as the Adobe Acrobat Javascript reference can this information be found? Under the setItems () method, I guess I should have read the fine print displayed to the right of the oarray parameter. Duh?

try67
Community Expert
Community Expert
February 9, 2022

Yes, it's described in the documentation of this method (highlighted below), and in the two last examples given there: