Skip to main content
Participating Frequently
May 17, 2017
Answered

Drop Down Menu Export Value

  • May 17, 2017
  • 1 reply
  • 41658 views

I'm new here and fairly new to creating PDF forms. Here is what I am trying to accomplish on my PDF form. I created a Drop Down Menu and in the Properties-Options Item section I entered employee names and in the Export Value their phone number. My hopes are when selecting their name from the drop down menu it will insert their phone number in a text field, that's the function I am trying to figure out.

Thanks

George

This topic has been closed for replies.
Correct answer try67

Got that - I changed the drop down name to employee, what's next, insert this code in the text field - Custom Calculation ?


Yes.

1 reply

try67
Braniac
May 17, 2017

Do you want the phone text field to be editable by the user, or should it

always have a value based on the selection in the drop-down?

gbwiiiAuthor
Participating Frequently
May 17, 2017

Always based on the drop down slection

Thom Parker
Inspiring
December 20, 2019

Hi, I have something similar I would like to do. I have a dropdown box which I want to use to poplulate a textbox with the export value of each choice. The difference is that I want to use the dropdown box as a multi-select box. Each time you select a value, it adds it to the textbox. If you select the same value again, it deletes it from the textbox. My dropdown has Items with a descriptive value and Export Values with a code, so that the form user can pick what they want without having to know the code; while the form receiver can quickly use the codes to complete the task.

 

I found a document level script online here and it works great, but does not place the Export Value, only the Item value. Would you know what needs to be replaced in the code to access the Export Value instead of the Item value? I had understood (maybe incorrectly) that if the Export Value was filled in, that that automatically became the value that would be chosen, but it doesn't seem to execute that way.

 

I have asked the question here rather than there, as it says that that forum is now read only. Thanks very much for any assistance you can provide.


To add items to the same value use the "+=" operator

 

this.getField("textfield").value += event.value;

 

Read this article for more detail on how use a Keystroke script to get the export value:

https://acrobatusers.com/tutorials/change_another_field

 

You'll find much more info on list fields here:

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often