Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

43

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

correct answers 1 Correct answer

Adobe Community Professional , 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;

Likes

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

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

Copy link to clipboard

Copied

Thanks Amal!

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
community guidelines
Adobe Community Professional ,
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.

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
community guidelines
Adobe Community Professional ,
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;

 

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
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!

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