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

Auto populate fields

leo
Registered: Feb 7 2007
Posts: 4

I have several insurance applications that have require much of the same informtion. Is there a way to have a PDF form that I could fill out and auto populate the information in the apps so I would'nt have to type the same information in several times. Tahnk you

My Product Information:
Acrobat Pro 7.0.4, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Leo,

Did you make the forms fillable and create the names of the fields on the forms? For Example, on the first application you may have a field named "FirstName" and you have that same field on two other applications also named "FirstName." If that is the case you could combine the 3 forms into one PDF. Now when you enter something into the "FirstName" field on one page all other fields in the PDF with the same name will be automatically filled with that entry.

This route won't work if all the fields are named differently or if it is not feasible for you to combine the PDFs together. There is a good explanation on how to combine PDFs in Acrobat's Complete Help file.

Hope that helps,

Dimitri Munkirs
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
amyaecci
Registered: Nov 6 2008
Posts: 7
Dear Dimitri,

I would like to accomplish exactly what you have explained to Leo, but is it possible to do this with fields that are on the same page? I would like the user to enter information on a fillable Work Order Form in two separate fields (Job# & Work Order#) and it populate a master Work Order#. For example, the user enters Job# 08-08 in one field, Work Order# 017 in anther field (from a drop-down list), and it populates a master Work Order Number at the top of the page "08-08-017" that is easily identifiable throughout the company. But I need all this on the same page.Is this possible?

-Amy
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
To do that you could set up a custom Calculation script for the master field. The script would get the values from the Job# and Word Order# fields, and if they both have an entry, combine the values and set the master work order number field value. It could look something like:

// Get the value of the Job# field, as a stringvar s1 = getField("Job#").valueAsString; // Get the value of the Work Order# field, as a stringvar s2 = getField("WorkOrder#").valueAsString; // If there is an entry in both fields...if (s1 && s2) { // Combine field values, separated by a dashevent.value = s1 + "-" + s2; } else { // Blank this field if the other fields are not completeevent.value = ""; }

You'd have to replace the "Job#" and "WorkOrder#" in the code above to match the names of the fields you're using. It doesn't matter which pages the field's in question are placed on. They can be on the same page or different pages.


George
amyaecci
Registered: Nov 6 2008
Posts: 7
George,

I have had time to investigate this and I have realized that I should mention that I am using Adobe Designer Version 7. I assume that does not affect my being able to ask questions here on the Acrobat Community? In that case...

Since I cannot find a place to enter a custom calculation script like in Acrobat, this means that I would actually enter the Custom Calculation Script in the XML Source?

Below is the Javascript for the Work Order Field (WOTextField). Can you show me how I would edit the script to reflect the changes I want to make?

-Amy

</traversal><field xmlns="http://www.xfa.org/schema/xfa-template/2.1/" name="WOTextField" y="5.29mm" x="158.22mm" w="31.7402mm" h="14.0201mm"><ui><textEdit><border xmlns="http://www.xfa.org/schema/xfa-template/2.2/" presence="hidden"><?templateDesigner StyleID aped0?></border><margin/></textEdit></ui><font typeface="Myriad Pro" size="18pt" weight="bold"><fill xmlns="http://www.xfa.org/schema/xfa-template/2.2/"><color value="255,0,0"/></fill></font><margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/><para vAlign="middle" hAlign="right"/><caption reserve="0in"><font typeface="Myriad Pro" size="18pt" weight="bold"><fill xmlns="http://www.xfa.org/schema/xfa-template/2.2/"><color value="255,0,0"/></fill></font><para vAlign="middle" hAlign="right"/></caption><value xmlns="http://www.xfa.org/schema/xfa-template/2.2/"><text maxChars="9"/></value><format xmlns="http://www.xfa.org/schema/xfa-template/2.2/"><picture>99-99-999</picture></format><bind xmlns="http://www.xfa.org/schema/xfa-template/2.2/" match="none"/><calculate xmlns="http://www.xfa.org/schema/xfa-template/2.2/" override="warning"/>
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
> I assume that does not affect my being able to ask questions here on the Acrobat Community?Absolutely not! But you may increase your odds of getting an answer by posting this in the "Forms: LiveCycle Designer" forum.

Entering code in Designer is indeed different than in Acrobat. Look in Designer's help for more information on the Script Editor. After you get the Script Editor to become visible, you'd select the field you want to affect, select the Calculate event in the "Show" box, and select the scripting language (FormCalc vs. JavaScript) in the "Language" box.

George
amyaecci
Registered: Nov 6 2008
Posts: 7
George_Johnson wrote:
Entering code in Designer is indeed different than in Acrobat. Look in Designer's help for more information on the Script Editor. After you get the Script Editor to become visible, you'd select the field you want to affect, select the Calculate event in the "Show" box, and select the scripting language (FormCalc vs. JavaScript) in the "Language" box.
I accomplished all of that and still is not auto-populating the field. The field is set to "Calculated - Read Only". Any suggestions. Below is the code I copied from the Script editor in Designer.

----- F.P1.WOTextField::calculate - (JavaScript, client) ------------------------------------------- // Get the value of the JobNumField field, as a stringvar s1 = getField("JobNumField").valueAsString; // Get the value of the WONumField field, as a stringvar s2 = getField("WONumField").valueAsString; // If there is an entry in both fields...if (s1 && s2) { // Combine field values, separated by a dashevent.value = s1 + "-" + s2; } else { // Blank this field if the other fields are not completeevent.value = ""; }
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
That code was intended to be used with Acrobat, so it will not work with Designer.

I'll see if I can come up with something later, or maybe someone else here can help...

George