Copy link to clipboard
Copied
Hello,
Every formula I have found seems to not be working for this issue. I am trying to auto populate text when a selection is made on a drop down list in Adobe Acrobat Pro.
Drop down box is labeled "Application" and text field is "Application Owner" when a selection is made under "Application" I want the owner of each application to auto fill in the text field "Application Owner" I have 6 applications to chose from and 5 owners.
I'm not sure if this would work better if both boxes were drop downs?
Please help!!!
Thank you!
Copy link to clipboard
Copied
As validate script of dropdown field use this:
var f = this.getField("Application Owner");
if(event.value == "Selection for owner1")
f.value = "Info for owner1";
else if(event.value == "Selection for owner2")
f.value = "Info for owner2";
else if(event.value == "Selection for owner3")
f.value = "Info for owner3";
//add more 'else if' lines here for other choices as needed
else
f.value = "";
Change "Selection for owner" to your actual choices in dropdown and "Info for owner" with info for that owner you would like to show in "Application Owner".
Copy link to clipboard
Copied
As validate script of dropdown field use this:
var f = this.getField("Application Owner");
if(event.value == "Selection for owner1")
f.value = "Info for owner1";
else if(event.value == "Selection for owner2")
f.value = "Info for owner2";
else if(event.value == "Selection for owner3")
f.value = "Info for owner3";
//add more 'else if' lines here for other choices as needed
else
f.value = "";
Change "Selection for owner" to your actual choices in dropdown and "Info for owner" with info for that owner you would like to show in "Application Owner".
Copy link to clipboard
Copied
Thank you! I'm not sure if I have an error in here but this is the formula I entered (removed names for post) and my text field isn't auto populating with the name..
"Application Owner" is the name of the text box where I want "Owner Name" to appear. I enterned the JavaScript in the drop down properties. Drop down name is "Application".
var f = this.getField("Application Owner");
if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name"
else if(event.value == "Application Name")
f.value = "Owner Name"
else if(event.value == "Application Name")
f.value = "Owner Name"
Copy link to clipboard
Copied
It looks ok, did you set export values in dropdown field?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I figured out where I went wrong. Thank you so much!!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Where did you put the script? Can you share your file?
Copy link to clipboard
Copied
I'm doing something similar and I really don't get this at all. This is my first time trying to do anything like this in a PDF. So, I have a Dropdown called ServiceType and a Text field called ServiceChoice. I want text to appear in ServiceChoice based on the selection from ServiceType as follows:
ServiceType = Gas Service
ServiceChoice = Gas facilities
ServiceType = Electric Service
ServiceChoice = Electric facilities
ServiceType = Gas and Electric Service
ServiceChoice = Gas and Electric facilities
Right now I have:
var f = this.getField("ServiceChoice");
if(event.value == "Gas Service")
f.value = "Gas facilities";
else if(event.value == "Electric Service")
f.value = "Electric Facilities";
else if(event.value == "Gas and Electric Service")
f.value = "Gas and Electric Facilities";
in the Validate Custom Script for my dropdown box.
What do I need to do? Also, I'm on a work computer, so I cannot see attached images or files.
Copy link to clipboard
Copied
The script looks ok, what happens when you make selection in dropdown?
Check console (CTRL+J) for errors.
Copy link to clipboard
Copied
I JUST figured it out. I didn't realize the part about the Export Validation. I had to look that up separately.
So once I put those in there, it works seamlessly! 🙂
I'm still confused why, but hey, it works. I now have "Gas Service." as my Item Name and "Gas Service" as the Export Value. Seeing as my script references the "Gas Service.", I don't know why I need to have the Export Value in there.
This is how I have it now.
var f = this.getField("ServiceChoice");
if(event.value == "Gas Service.")
f.value = "Gas facilities";
else if(event.value == "Electric Service.")
f.value = "Electric Facilities";
else if(event.value == "Gas and Electric Service.")
f.value = "Gas and Electric Facilities";
Copy link to clipboard
Copied
You don't need export value, but you didn't check right condition in your first script you forgot dot on the end.
You can use export value but like this:
"Gas Service." export value "Gas facilities"
"Electric Service." export value "Electric Facilities"
"Gas and Electric Service." export value "Gas and Electric Facilities"
then as custom calculation script of dropdown use this:
this.getField("ServiceChoice").value = event.value;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This may be a rookie questions, but should the custom calculation script be associated witht he ContractName field or the drop down field?
Copy link to clipboard
Copied
I found my mistake. Thank you for your help.