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

Showing or hidding subforms using dropdowns

jrperez
Registered: Aug 27 2008
Posts: 11

Hello everyone im new to using livecycle and not to familiar with java script but I have been learning a couple of things. I am wondering if you have to have the subforms that you are trying to hide under the parent subform or if you can have it somewhere else. I cannot figure out what my problem is with my java script. This is an example of what I have so far and I cannot figure out what I did wrong since the subforms im trying to show are in a separate subform which are not underneath this subform. I appreciate all the help I can get.

----- topmostSubform.OfferChecklist.Part.Pay::change: - (JavaScript, client) -----------------------

if
(pay.xfa.event.change == "Salaried (not-hourly)"){
BaseSalary.presence = "visible";
HourlyWage.presence = "invisible";// or "hidden"
}
else
if
(pay.xfa.event.change == "Hourly"){
HourlyWage.presence = "visible";
BaseSalary.presence = "invisible";// or "hidden"
}

My Product Information:
LiveCycle Designer, Windows
sconforms
Expert
Registered: Jul 10 2007
Posts: 92
jrperez,

You can show/hide any subform in your form. It doesn't need to be anywhere in context of the drop down list. The key is to address it properly however if you have given it a unique name (i.e. no other object of any kind has the same name), you can usually just use the subform's name from anywhere.

I'm guessing the problem lies in the way you're trying to determine what has been selected in the drop down list's Change event. What you want to do is look at the

xfa.event.newText

property and compare it to some value you expect to be in the list. For example,

if (xfa.event.newText == "Hourly")
{
// show/hide appropriate subforms
}

Stefan Cameron obtained his bachelor's degree with Honors in Computer Science at the University of Ottawa and is a Computer Scientist working on Adobe's LiveCycle server products, in particular on LiveCycle Designer ES for the past 5 years.