Copy link to clipboard
Copied
I’m Not very familiar with this in Adobe Acrobat Pro DC. Would like to create a dropdown list with certain City Names and when one is selected it populates the State field and Zip Code field with the corresponding information.
I've looked and found a few things but it's all very confusing to me.
Thanks for any input!
After some trial and error I got things working in a very simple mannor with out using an embedded or external data source.
I created my dropdown with each City and added the State & Zip Code to the Export Value field for each City and selected "Commit selected value immediately".
Then on the text field where the State and Zip Code are displayed, I added this to the "Custom Calculation Script", event.value = this.getField("City").valueAsString;
The only draw back is that the City & Zip Code are
...Copy link to clipboard
Copied
You will need to use a custom-made script to do it, and the full data set will have to be embedded in the file, either as a part of the script, or read from an external source, like an attached text file.
I've actually developed a (paid-for) tool that allows you to do it very easily, without having to write any code.
You can find it here: https://www.try67.com/tool/acrobat-populate-fields-from-dropdown
Copy link to clipboard
Copied
After some trial and error I got things working in a very simple mannor with out using an embedded or external data source.
I created my dropdown with each City and added the State & Zip Code to the Export Value field for each City and selected "Commit selected value immediately".
Then on the text field where the State and Zip Code are displayed, I added this to the "Custom Calculation Script", event.value = this.getField("City").valueAsString;
The only draw back is that the City & Zip Code are displayed in the same field but for my application this will work.
Thanks for your suggestion.
Copy link to clipboard
Copied
You can easily fix that last issue.
Change your output format to "State,ZipCode" and then as the custom calculation script of the State field use this:
event.value = this.getField("City").valueAsString.split(",")[0];
And under the Zip Code field use this:
event.value = this.getField("City").valueAsString.split(",")[1];
Copy link to clipboard
Copied