Highlighted

Select Item from Dropdown list but export a different value

New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

I'm using a Dropdown List box. I have already added the "Items" to be displayed. However, when I select an item, I would like for a different value to be exported in to the same box. For example: Let's say my list contains the list of the 50 states, each state spelled out. When I select "Texas", I would like for the value exported to be "TX".

 

Snooping around I found this code, but nothing happens

event.value = event.target.getItemAt(event.target.currentValueIndices, true);

I'm inserting it in the Validate tab - Run Custom Validation Script. I've also tried it on the Calculate tab - Custom Calculation Script:

 

Is there something I'm missing here?

Any help would be much appreciated. Thanks

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

38

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

Select Item from Dropdown list but export a different value

New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

I'm using a Dropdown List box. I have already added the "Items" to be displayed. However, when I select an item, I would like for a different value to be exported in to the same box. For example: Let's say my list contains the list of the 50 states, each state spelled out. When I select "Texas", I would like for the value exported to be "TX".

 

Snooping around I found this code, but nothing happens

event.value = event.target.getItemAt(event.target.currentValueIndices, true);

I'm inserting it in the Validate tab - Run Custom Validation Script. I've also tried it on the Calculate tab - Custom Calculation Script:

 

Is there something I'm missing here?

Any help would be much appreciated. Thanks

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

39

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
Aug 06, 2020 0
ls_rbls LATEST
Adobe Community Professional ,
Aug 06, 2020

Copy link to clipboard

Copied

Place the code as custom format script.

 

See slide:

 

exportvalue-custom-combobox.png

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
Reply
Loading...
Aug 06, 2020 0