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

How can I use a dropdown menu item selection to change another field value?

Community Beginner ,
Sep 27, 2016 Sep 27, 2016

Copy link to clipboard

Copied

Hi guys! I'm working for a Medical Care Center and I have to create a PDF file which has to contain some form fields. I've managed to create most of these fields but I got stuck at a dropdown menu. The dropdown menu contains the names of 83 employees. Each employee has a unique 6 numbers code. I'd like these code to automatically appear in another field based on the selection a make in the drop down menu field. Is there a way to do this without scripts? I'm not a programmer and have no programming abilities. I’m working in Adobe Acrobat Pro DC!

Forms.jpg

TOPICS
Acrobat SDK and JavaScript , Windows

Views

2.4K

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 , Sep 27, 2016 Sep 27, 2016

You can do it using a very simple script.

Basically what you need to do is set the export value of each item in your drop-down to the code corresponding to that person and then use this code as the custom calculation script of the text field (replace "Employee" in the code with the actual field name, of course):

event.value = this.getField("Employee").valueAsString;

PS. You should also enable the option to commit the selected value immediately in the drop-down field. You'll find it under the field'

...

Votes

Translate

Translate
Community Expert ,
Sep 27, 2016 Sep 27, 2016

Copy link to clipboard

Copied

You can do it using a very simple script.

Basically what you need to do is set the export value of each item in your drop-down to the code corresponding to that person and then use this code as the custom calculation script of the text field (replace "Employee" in the code with the actual field name, of course):

event.value = this.getField("Employee").valueAsString;

PS. You should also enable the option to commit the selected value immediately in the drop-down field. You'll find it under the field's Properties, Options tab.

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 ,
Sep 27, 2016 Sep 27, 2016

Copy link to clipboard

Copied

Aaa... ok.. it seems so easy when I read it and I'm sure it is but how do I set this "export value" of every item in  the dropdown menu? I mean I know I'll have to insert this code somewhere but where does this magical place rest ?

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 ,
Sep 27, 2016 Sep 27, 2016

Copy link to clipboard

Copied

When you add an item to the drop-down field there are two fields available: Item and Export Value. The former is the name, in your case, and the latter is the code. So it will look something like this:

The code I provided should be placed in the third option of  the Calculate tab of the code text field.

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 ,
Sep 27, 2016 Sep 27, 2016

Copy link to clipboard

Copied

Magical I was just writing back to tell you that I found it. Thanks man, you're great!

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 ,
Sep 28, 2016 Sep 28, 2016

Copy link to clipboard

Copied

Hi there! Well.. sorry to bother again but it seems that I'm stuck again. I can't manage to work with this. I'm attaching the file to this post and maybe you could just make only one option/selection to work then reattach the file and I'll just repeat the steps you did based on the script. So I have the dropdown menu field with the names and the export value corresponding to each name already completed. Now I just need the right script for the "COD PARAFA" field to show the export value of a selected name from the "MEDIC" drop down menu. Thank you in advance!

http://www.filehosting.org/file/details/605100/Fise%20pacienti%20intreg.pdf​

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 ,
Sep 28, 2016 Sep 28, 2016

Copy link to clipboard

Copied

Please use a file-sharing website like Dropbox or Google Drive. I'm not going to give my email address to some unknown website.
If you prefer you can email it to me directly to try6767 at gmail.com.

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 ,
Sep 28, 2016 Sep 28, 2016

Copy link to clipboard

Copied

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 ,
Sep 28, 2016 Sep 28, 2016

Copy link to clipboard

Copied

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 ,
Sep 28, 2016 Sep 28, 2016

Copy link to clipboard

Copied

LATEST

You Sir are awesome! I thoght it would be much more difficult but it was actually so simple. THANK YOU SO MUCH! I shall bother you no more on this issue

Thread closed!

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