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

How do I return the Display Text when I have a different Value Text

Community Beginner ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

I have a dropdown with multiple choices, and each choice has its own value text used to calculate an answer in another field, but I need to return the display text in a different field. Can anyone help, please?

TOPICS
Create PDFs , How to , JavaScript , PDF forms

Views

399

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

Community Expert , Aug 24, 2021 Aug 24, 2021

As custom calculation script of field where you want to show display text use this and rename dropdown field name to your actual field name:

var f = this.getField("Dropdown1");
var a = f.currentValueIndices;
var x = f.getItemAt(a, false);
event.value = x;

 

Votes

Translate

Translate
Adobe Employee ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

Hi Jsand

 

Hope you are doing well and sorry for the trouble. The workflow that you are trying to achieve is might be possible using the JavaScript.

For more information about using the JavaScript please check the help page https://acrobatusers.com/tutorials/javascript_console/

 

Hope this information will help

 

Regards

Amal

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
Community Beginner ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

Thanks Amal!

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
Community Expert ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

The event.value property, accessed in the drop-down's own Validation event, will return the display value of the selected item.

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
Community Expert ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

As custom calculation script of field where you want to show display text use this and rename dropdown field name to your actual field name:

var f = this.getField("Dropdown1");
var a = f.currentValueIndices;
var x = f.getItemAt(a, false);
event.value = x;

 

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
Community Beginner ,
Aug 24, 2021 Aug 24, 2021

Copy link to clipboard

Copied

LATEST

You are now my most favorite person on the planet! It is exactly what I was looking for, Thank You so much and I hope you have a wonderful day!

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