Copy link to clipboard
Copied
How can I reference a field's "Item" value of a dropdown selection, instead of its "Export Value?"
I have multiple items with the same export value but I need to reference the "Item" value.
For example...
Item: "Included", Export Value: 0
Item: "Excluded", Export Value: 0
Item: "$1000", Export Value: 1000
Since the export values of 2 of the items are the same, I need to reference the "Item" value.
I'd also like to populate another form field with the selected item's "Item" value.
Acrobat doesn't stop you have entering the same Export value for two entries, but they really should be unique.
Regardless, you can acquire the display value with the "field.getItemAt()" function. Get the index from the "field.currentValueIndicies" property.
However, if you are acquiring values during the format or validate event, the display value is in "event.value". Use this if you're using these events. In the Keystroke event the display value of the newly selected item is in event.change,
...Copy link to clipboard
Copied
Acrobat doesn't stop you have entering the same Export value for two entries, but they really should be unique.
Regardless, you can acquire the display value with the "field.getItemAt()" function. Get the index from the "field.currentValueIndicies" property.
However, if you are acquiring values during the format or validate event, the display value is in "event.value". Use this if you're using these events. In the Keystroke event the display value of the newly selected item is in event.change, and the export value is in event.changeEx.
Here's an article on changing another field with a dropdown selection.
https://acrobatusers.com/tutorials/change_another_field
And here's more on using lists and dropdowns.
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm