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

Drop Down Menu Export Value

New Here ,
May 17, 2017 May 17, 2017

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

TOPICS
Create PDFs
41.9K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
May 17, 2017 May 17, 2017
Translate
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 ,
May 17, 2017 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?

Translate
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
New Here ,
May 17, 2017 May 17, 2017

Always based on the drop down slection

Translate
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 ,
May 17, 2017 May 17, 2017

As the custom calculation script of the Phone field enter this code (adjust the field name as required):

event.value = this.getField("employee").value;

Translate
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
New Here ,
May 17, 2017 May 17, 2017

Ok - So I create a text field name it employee and insert this code ?

Translate
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
New Here ,
May 17, 2017 May 17, 2017

Lost need more direction !

Translate
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 ,
May 17, 2017 May 17, 2017

No. "employee" was what I assumed the drop-down field was called... Replace it with the actual field name, as I'm mentioned.

Translate
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
New Here ,
May 17, 2017 May 17, 2017

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

Translate
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
New Here ,
May 17, 2017 May 17, 2017

It's working !!!

Thank You Greatly Appreciated !

Translate
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 ,
May 17, 2017 May 17, 2017

Yes.

Translate
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 ,
Dec 20, 2019 Dec 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.

Translate
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 ,
Dec 20, 2019 Dec 20, 2019

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 ,
Dec 23, 2019 Dec 23, 2019

Thank you for your reply. Unfortunately, I have read the links that you provided already. I got lost on the part about pre-population data in the document script as all I want is a list with Item values that returns the Export values. I apologize that I am not a javascript programmer. My limits are finding a script online and filling in my fields in place of the fields in the script and hoping it works. The script I found works fine, adding items and removing items to the textbox from the combo box with a click. That is not the issue. The issue is that it places the Item Value, whereas I would like it to place the Export value. This is a document level script, so adding a keystroke script would be starting all over again from scratch with script in the Keystroke box on the Format tab, would it not?

Translate
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 ,
Dec 23, 2019 Dec 23, 2019

Please post your question to a new thread. Include a description of what you want to achieve, the current code you are using, and clearly specify the feild event where this code is being run. 

 

 

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

Translate
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 ,
Dec 23, 2019 Dec 23, 2019

My apologies, I did not think it was appropriate to start a new thread for the same basic question. I will do so now.

Translate
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 ,
Dec 23, 2019 Dec 23, 2019

New post is here as requested.

Translate
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 ,
Nov 19, 2018 Nov 19, 2018

i want to edit this text field ... how plz ??

Translate
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 ,
Nov 19, 2018 Nov 19, 2018

Please be more specific about the situation and what you want to achieve.

Translate
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 ,
Sep 09, 2020 Sep 09, 2020

Hi, I have this exact requirement with two small changes i.e.

  1. the phone text field should be editable by the user;
  2. the user should be able to freely change the dropdown options even after editing the phone text field which would show an appropriate corresponding Export Value again allowing user  to edit it. 
Translate
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 ,
Sep 10, 2020 Sep 10, 2020
LATEST

Make the text field that shows the phone number editable. 

 

Or do you mean that you want the export values of the dropdown items (phone numbers) to change when the phone number field is edited? 

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

Translate
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