Copy link to clipboard
Copied
What I'm trying to do is set up my pdf file so that if I choose one name from a drop down list, it will automatically populate other fields with pertinent information for that name, such as DOB, address, phone number, etc. I cannot seem to figure this out, and I'm just going in circles at this point. I sure hope someone can help me out.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This can be done using a script. For example, see: https://acrobatusers.com/tutorials/change_another_field
I've developed a tool that allows you to set it up easily and quickly, without having to write any code.
If you're interested you can find it here: Custom-made Adobe Scripts: Acrobat -- Populate Fields From Dropdown
Copy link to clipboard
Copied
I'm still beating my head against the wall. Would anyone be willing to take a look at my script and see if you can figure out what I've done wrong? I'm new to this, and I'm getting really frustrated. I think I've stared at it so long, that it's all running together. Ugh.
Under format on my combo box drop down, I have custom keystroke set up as
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["Breeder","Sex","DOB","RegNum","RegName","Sire","Dam"]);
else
SetFieldValues(event.value);
And for my script under "document level" i have a script named SetFieldValues with
// Place all pre-population data into a single data structure
var DogData = { Ace :{ Breeder: "Sherita Tabner & Carol Enz",
Sex: "Male",
DOB: "11/17/2015",
RegNum: "HP488851/01",
RegName: "Rose Hill Kachina Stroker Ace",
Sire: "FC Rose Hill Classic Photo SC",
Dam: "Rose Hill Absolut" }
Sally :{ Breeder: "S. Tabner, C. Enz, A. McCabe",
Sex: "Bitch",
DOB: "11/24/2015",
RegNum: "HP487173/02",
RegName: "Rose Hill Kachina Mustang Sally",
Sire: "FC Rose Hill Barracuda SC",
Dam: "Kyrov Rose Hill Calliandra"}};
function SetFieldValues(cCallName)
{
this.getField("Breeder").value = DogData[cCallName].Breeder;
this.getField("Sex").value = DogData[cCallName].Sex;
this.getField("DOB").value = DogData[cCallName].DOB;
this.getField("RegNum").value = DogData[cCallName].RegNum;
this.getField("RegName").value = DogData[cCallName].RegName;
this.getField("Sire").value = DogData[cCallName].Sire;
this.getField("Dam").value = DogData[cCallName].Dam;
}
So, what am I doing wrong? All of it? Or did I miss something? I have several other dogs that need to be added, but until I can figure ot what's going on, I'm not going to spend a couple hours doing it.
Help?
Copy link to clipboard
Copied
Can you share the form?
Copy link to clipboard
Copied
Yes, if I can figure out how. I'll try to do that as soon as I get home. Thank you!
Copy link to clipboard
Copied
Try as I might, I cannot figure out how to upload the document. So, instead, I've put it on my website where it should be easily accessed.
www.rabbitz.net/ENTRYworking.pdf
Hopefully you can open it and see the code. I'm just at a loss at this point, and disgusted.
Copy link to clipboard
Copied
Use this:
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["Breeder","Sex","DOB","RegNum","RegName","Sire","Dam"]);
else
SetFieldValues(event.value);
}
Copy link to clipboard
Copied
Still no luck Any other ideas? When I choose a name from the combo box, I get no response from the document
Copy link to clipboard
Copied
Look for errors in the debugger.
Copy link to clipboard
Copied
Thanks for the suggestion. I do appreciate all of your help, but I give up. It's apparent that my brain does not comprehend what I need it to in order to figure this out. I'll have to figure out a way other than using javascript.
Copy link to clipboard
Copied
I don't mind paying someone to help me sort this out. I need this thing done. I'll probably never need it again, but I sure need this one now.
Copy link to clipboard
Copied
I finally figured it out, but it wasn't with either of the examples above. I set up a keystroke custom script, and a validation script with all the information I needed to show up. Now, it works like a charm
Find more inspiration, events, and resources on the new Adobe Community
Explore Now