Skip to main content
Participant
August 24, 2021
Answered

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

  • August 24, 2021
  • 3 replies
  • 751 views

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?

This topic has been closed for replies.
Correct answer Nesa Nurani

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;

 

3 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
August 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;

 

Jsand8Author
Participant
August 24, 2021

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!

try67
Community Expert
Community Expert
August 24, 2021

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

Amal.
Legend
August 24, 2021

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

Jsand8Author
Participant
August 24, 2021

Thanks Amal!