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

Subforms

churchw
Registered: Jul 28 2008
Posts: 6

Hi, sorry if someone has already posted this question:

I am creating a PDF using Adobe Designer and I am having some trouble with the subforms.

I have a dropdown text menu titled "Number of Dependents" with options "1", "2", and "3". Depending on which option I choose, I would like a certain subform (out of 3) to be displayed.

As an example:

If hit "Number of Dependents" and select "1", I want subform1 to be displayed. If I select "2", I want subform1 and subform 2 to be displayed.
If I select "3", I want subform1, subform2, and subform3 to be displayed

My Product Information:
LiveCycle Designer, Windows
goodbye
Registered: Jul 7 2008
Posts: 49
this question gets posted a lot but because it is not intuitive on how to do this if new to LiveCycle. so don't feel bad about asking :)

drop-down lists use the change event to read the users value and the example here uses relative paths where "this" is the drop-down list.

this example uses client side JavaScript on a dynamic form:

TopmostSubform.Page1.delphiProduct::change - (JavaScript, client)

if (this.xfa.event.change == this.xfa.event.change == "Delphi Multi-Property") {
TopmostSubform.Page2.salesHomeIntro.presence = "invisible";
TopmostSubform.Page2.SalesManagerProductivity.presence = "invisible";
TopmostSubform.Page2.salesHomeEmpty.presence = "visible";
}
else if (this.xfa.event.change == "Delphi Single-Property") {
TopmostSubform.Page2.salesHomeIntro.presence = "visible";
TopmostSubform.Page2.SalesManagerProductivity.presence = "visible";
TopmostSubform.Page2.salesHomeEmpty.presence = "invisible";
}
else {
TopmostSubform.Page2.SalesManagerProductivity.presence = "visible";
}



and on each subform, in the Object palette, select "hidden" (for flowed forms) or invisible to initially have the subforms hidden.

make sure to set File > Form Properties > Defaults and set JavaScript for Default Language and Default Run At to Client (if that meets your needs)the do File As and select Adobe Dynamic XML Form

you might already have done this, I just found the process to be a bit convaluted and circuitous
churchw
Registered: Jul 28 2008
Posts: 6
Hi subquark. Thanks a lot.
Unfortunately I am not experienced with JavaScript.

"Delphi Single-Property" is an example of one of the choices from the dropdown menu, right?


"TopmostSubform.Page2.saleshomeIntro.presence" would be the name of the 1st subform?

Where would I enter the data in the JavaScript?

Sorry for my lack of understanding
goodbye
Registered: Jul 7 2008
Posts: 49
hi :) no problem at all, I am a neophyte at this and it gets really frustrating trying to figure it out. Here is a closer example:

TopmostSubform.Page1.NumberOfDependents::change - (JavaScript, client)
if (this.xfa.event.change == "1") {
Subform1.presence = "visible";
Subform2.presence = "invisible";
Subform3.presence = "invisible";
}
else if (this.xfa.event.change == "2") {
Subform1.presence = "invisible";
Subform2.presence = "visible";
Subform3.presence = "invisible";
}
else if (this.xfa.event.change == "3") {
Subform1.presence = "invisible";
Subform2.presence = "invisible";
Subform3.presence = "visible";
}

else {
Subform1.presence = "invisible";
Subform2.presence = "invisible";
Subform3.presence = "invisible";
}

So open the scripting window (Window > Script Editor) and expand it so that you can see several lines. Then in that window in the upper left on how, select :change. If you have your drop-down box selected, you will see it's name like this "TopmostSubform.Page1.NumberOfDependents::change - (JavaScript, client)". That's what the first line of code is above. On the upper right you should select Language: JavaScript and Run At: Client.But this can also be done with FormCalc, that's kinda the code that Adobe created for PDFs. But JavaScript is a little more flexible (imo).

So try that and post again, it's a slow go and I am so new too. :)
churchw
Registered: Jul 28 2008
Posts: 6
Hi subquark,

sorry for posting so late.

I entered the JavaScript, but it didnt work. Im going to go over it just to make sure everything is correct. I know that any little mistake can mess everything up. Thanks again