Skip to main content
Inspiring
February 28, 2017
Answered

Acrobat DC: Autofill two fields based on choice from drop down menu in third filed

  • February 28, 2017
  • 1 reply
  • 2680 views

I have a very complicated (to me) form that was originally designed in Excel.

One field will have a drop down menu of 28 departments.

I would like to have two other fields auto populate based on the choice made in the first field.

I have tried various methods, a custom validation script and other script examples I have found on support boards, but I can't seem to get it to work.

Here is the document:

DRAFT.pdf - Google Drive

I have changed the names of the fields in my working copy so there are no extraneous spaces or special characters (such as /)

The drop down menu is in the DeptUnit field, I would like to autofill the Business Center and Contact field based on the selection made.

So if DeptUnit is "Accounting", BusinessCenter = "ACT" and Contact = "Jane Smith"

I am not very strong in javascript, so your patience is appreciated.

Thank you

This topic has been closed for replies.
Correct answer akunce

Oh I think I found it.

I used different search terms and found a custom validation scrip from try67.

  1. if (event.value == "ABC") { 
  2.     this.getField("Text1").value = "123"
  3.     this.getField("Text2").value = "456"
  4. } else if (event.value == "DEF") { 
  5.     this.getField("Text1").value = "789"
  6.     this.getField("Text2").value = "000"
  7. } // etc. 
  8. else { 
  9.     this.getField("Text1").value = ""
  10.     this.getField("Text2").value = ""

1 reply

akunceAuthorCorrect answer
Inspiring
February 28, 2017

Oh I think I found it.

I used different search terms and found a custom validation scrip from try67.

  1. if (event.value == "ABC") { 
  2.     this.getField("Text1").value = "123"
  3.     this.getField("Text2").value = "456"
  4. } else if (event.value == "DEF") { 
  5.     this.getField("Text1").value = "789"
  6.     this.getField("Text2").value = "000"
  7. } // etc. 
  8. else { 
  9.     this.getField("Text1").value = ""
  10.     this.getField("Text2").value = ""
Known Participant
June 13, 2018

Thanks... akunce and Try67. This worked great for me. Try67 has help me out many times! Always appreciated!!!