These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Auto populating text fields

bmccoy0529
Registered: Jan 6 2009
Posts: 2

I have several clients that I write notes on every month. Each client has a set of goals and objectives. The clients are setup in a drop down menu. Is there a way to auto populate those goals and objectives when I select there name from the drop down?

Any help on this would be much appreciated. thank you

My Product Information:
Acrobat Pro 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why yes, there is a way.

The easiest solution is to export the data from the form into an FDF, or other data format, into a standard folder location on your hard drive. Then use the dropdown to import the data back into the form.

Export the data from the "Forms->Manage Form Data->Export Data" menu item. Make the name of each file exactly the same as the name of the client, as it appears on the drop down menu.To import the data place a button on the form next to the drop down menu (I assume that you really mean a combobox). Set the MouseUp action for the button to "Run a JavaScript", and add the following code:

   var cPath = "/C/MyData/" + this.getField("Clients").value + ".FDF";this.importAnFDF(cPath);

Of course you will have to change the "/c/MyData/" to the real location where the data files are stored. This code also assumes that your drop down is named "Clients", so you'll have to change that as well.

This technique will work in Reader if the form is enabled with Reader Rights.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script