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

Display Export Value of dropdown instead of Item

Explorer ,
Jan 21, 2016 Jan 21, 2016

Copy link to clipboard

Copied

I'm trying to show the Export Value of a dropdown instead of the selected option i.e. the user selects BLACK but the export value of BLK is actually displayed.  I can find lots of discussions on how to pull the export value and display it or use it to trigger another response in another field and I can usually tweak my existing JavaScripts when I need something new but I cannot seem to wrap my head around this!

This is my latest (failed) attempt

var f = this.getField("eyes");

if (event.value == "Black - BLK")

f.value = "BLK"

I'm using Acrobat PRO DC.

Any help is appreciated,

Thanks

Meabh


TOPICS
Acrobat SDK and JavaScript , Windows

Views

5.4K

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
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 21, 2016 Jan 21, 2016

I've been doing this a long time, and have never heard of anyone wanting something like this, so it's interesting. Remove your current script and try the following as the custom Format script of the eyes dropdown:

// Custom Format script for dropdown

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

This sets what's displayed in the dropdown to the export value of the selected item. Select the "Commit selected value immediately" option for the dropdown for the smoothest

...

Votes

Translate

Translate
Community Expert ,
Dec 02, 2023 Dec 02, 2023

Copy link to clipboard

Copied

LATEST

Do you use any script, and where did you put the script?

On mobile, scripts will not work.

Votes

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
community guidelines