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

Combo Boxes in Live Cycle

aniemameba
Registered: May 29 2009
Posts: 12

Hello All! I am creating a form using Live Cycle and I need some things to "auto-populate." I saw the Tutorial on Combo Boxes in Acrobat and it is great but I was wondering if anyone knows the modifications to that for Live Cycle or if there is an easy way that I am missing.

Thanks!

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi aniemameba,

This tutorial on programming list fields in both Acrobat and LiveCycle Designer PDFs should get you started-
http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle

Hope this helps,

Dimitri
www.pdfscripting.com
www.windjack.com
aniemameba
Registered: May 29 2009
Posts: 12
I have taken a look at that and used that process on another form with multiple answers in the drop down but for this type of form, I only need one answer to populate after they select the first drop down.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi aniemameba,

Everything you need is in that LiveCycle Form example included in the tutorial. The second set of dropdown lists, when chosen, populate other fields with a single entry. So if you want a field to be populated with a single entry upon a dropdown choice, use the code from the second drop down box.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
aniemameba
Registered: May 29 2009
Posts: 12
Thanks Dimitri! How do I add a 3rd and 4th set of drop downs all to populate from the 1st drop down?
aniemameba
Registered: May 29 2009
Posts: 12
Ok so I went back to trying to do the Combo Box (the Acrobat Tutorial) in Live Cycle. The only thing that I am stumped at is what java script events do I put the following in?

I assume that this is the Change Event:
[b]if( event.willCommit )
{
if(event.value == "")
this.resetForm(["DeptContact","DeptEmail","DeptNumber"]);
else
SetFieldValues(event.value);
}[/b]What event do I put this part in? Is there anything else I need to put to make it work?
[b] Place all prepopulation data into a single data structure
var DeptData = { Accounting:{ contact: "Steala Damuni",
email: "accounting [at] mycomp [dot] com",
deptnum: "cmp1234" },
Engineering:{ contact: "Frank N. Stien",
email: "engineering [at] mycomp [dot] com",
deptnum: "eng1234" },
Marketing :{ contact: "Shelly Oughtbuks",
email: "marketing [at] mycomp [dot] com",
deptnum: "mkt1234" },
ITSupport:{ contact: "Goah Wei",
email: "it [at] mycomp [dot] com",
deptnum: "its1234" }};
function SetFieldValues(cDeptName)
{
this.getField("DeptContact").value = DeptData[cDeptName].contact;
this.getField("DeptEmail").value = DeptData[cDeptName].email;
this.getField("DeptNumber").value = DeptData[cDeptName].deptnum;
}[/b]
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Have you downloaded the form and edited it in LiveCycle Designer?

The function call for ''SetParameteres()' is in the 'Change' event of the 'Assembly' combo box in 'OrderItems' in the 'OrderSection' on 'Page1'.

'DeptData' dataobject and 'SefFieldValues' function is located at 'OrderItems', 'Variables', named 'Example1'.

George Kaiser

aniemameba
Registered: May 29 2009
Posts: 12
I have downloaded the "Using a Combo Box to Pre-populate Form fields" form and that does not easily convert into Live Cycle. I was wondering what changes need to be made to make it work in Live Cycle. (see 4th post on this chain)

I have also downloaded "Programming Lists Part 1, XFA Form Example" which works just fine in Live Cycle but I am stumped on how to add another drop down after Part instead of the Price field that is populated from the original Assembly drop down.

Thanks for your help!
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
With LiveCycle Designer you need the XFA forms. Do not try to convert an AcroForms (Acrobat) form to LiveCycle Designer as there are many differences between the 2 types of forms. LiveCycle Designer disables all of the Acrobat JavaScirpts.

While in LiveCycle Designer, and in the 'Design View' you select the button captioned 'Add Order Line' ('TopmostSubform.Page1.InfoSection.Button1') and with the 'Script Editor' window open you will see the script for the 'click' event:
Page1.OrderSection.OrderItems.instanceManager.addInstance();

George Kaiser

aniemameba
Registered: May 29 2009
Posts: 12
I am sorry, I think I didn't type what I needed very well. Using the "Programming Lists Part 1, XFA Form Example" I don't need another line to show up, I need a 3rd Drop Down box after "Part" but before "Price". Let just say this is for "Vehicle Make." How do I connect "Vehicle Make" populate from what was chosen in the first drop down "Assembly"? I know I have to add it into the subform, I just don't know what code is actually grabbing the "Assembly" choices to populate into the other fields.

Thanks!