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

Please help! Double conditions in Livecycle Form

francisvaneycken
Registered: Mar 30 2009
Posts: 37

Hello,

Can anybody help me please?

I've got a form with following changecondition on a checkbox:

form1.P1.LidBTSC::change - (JavaScript, client)
if(this.rawValue == 0)
Lidnummer.presence = "hidden";
else
Lidnummer.presence = "visible";
subform1.presence = "visible";
subform2.presence = "hidden";

This works perfectly when you click on the checkbox. The hidden box appears and the original subform2 gets replaced by subform.

When I uncheck this checkbox Lidnummer.presence gets back hidden but subform2 stays instead of being hidden and subform 1 stays hidden instead of appear.

When I write more than one line at the if-part, the whole action blocks.

For example : this is logic but does NOT work? Why not?

if(this.rawValue == 0)
Lidnummer.presence = "hidden";
subform1.presence = "visible";
subform2.presence = "hidden";
else
Lidnummer.presence = "visible";
subform1.presence = "hidden";
subform2.presence = "visible";

How can I solve this. Please help. Anyone?

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
If you want a block of code, more than one JavaScript statment, to be executed as part of a control statement you need to delimit the block of statements between the curly brackets.

if(this.rawValue == 0) {// block of code for true conditionLidnummer.presence = "hidden";subform1.presence = "visible";subform2.presence = "hidden";  }else {// block of code for not true conditionLidnummer.presence = "visible";subform1.presence = "hidden";subform2.presence = "visible"; }// code to always execute follows

George Kaiser

francisvaneycken
Registered: Mar 30 2009
Posts: 37
Thank you for this solution!