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

Drop Down List Problem

NStonerook
Registered: Feb 15 2011
Posts: 11
Answered

I am creating a pledge form where users have the option to choose
Payroll Deduction
Check
Credit Card etc.
 
All of these options are located in a drop down list and have the pertinent subforms either visible or hidden based on the user's selection ie
 
form1.P1.PledgeType::change - (JavaScript, client)
 
if (this.rawValue == 0)
{PayRoll.presence="visible"
OneTimePayRoll.presence="hidden"
CCInfo.presence="hidden"
CheckInfo.presence="hidden"
Bill.presence="hidden"
NoDon.presence="hidden"
Desig.presence="visible";}

else if (this.rawValue == 1)
{PayRoll.presence="hidden"
OneTimePayRoll.presence="visible"
CCInfo.presence="hidden"
CheckInfo.presence="hidden"
Bill.presence="hidden"
NoDon.presence="hidden"
Desig.presence="visible";}
AND SO ON...
 
This concept works... however the display is always one behind... I have to essentially choose everything twice in order for the correct subform to be displayed... Any thoughts?

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

for this purpose you better use the pseudo event modell.

  1. if (xfa.event.newText == 0)
  2. {
  3. PayRoll.presence="visible";
  4. ...
  5. }

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

NStonerook
Registered: Feb 15 2011
Posts: 11
With that script the displays no longer change at all....
NStonerook
Registered: Feb 15 2011
Posts: 11
Should this still be located in the "change" event? This newText concept sounds like a better option but I can't figure out why nothing is changing at all anymore...
NStonerook
Registered: Feb 15 2011
Posts: 11
Accepted Answer
I figured it out!!! I used your script, Radzmar. Thank you!!! But instead of using the numberic value in the "if" statement I had to use the actual text in quotation marks after the == sign. ie:

0. if (xfa.event.newText == "Payroll Deduction")
1. {
2. PayRoll.presence="visible";
3. ...
4. }

Thanks again for the nudge in the right direction!