Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Hiding Subforms

Avatar

Level 2
Ive been trying to manipulate a form that I found in the forum to do the following:



I have 6 checkboxes, and 6 subforms. I would like a subform to be visible when the corresponding checkbox is checked. The form Ive been tweaking is from Conditional Events topic 4/21/06 the form is HideSubformOnCheckMoveUp1. Heres what Ive done.



function ShowOptionalPart()

{

var oTopSubform = form1.Page1Subform.TopSubform;



if (oTopSubform.CheckBox1.rawValue == 1)

form1.Page1Subform.OptionalSubform.presence = "visible";

else

form1.Page1Subform.OptionalSubform.presence = "hidden";



if (oTopSubform.CheckBox2.rawValue == 1)

form1.Page1Subform.OptionalSubform1.presence = "visible";

else

form1.Page1Subform.OptionalSubform1.presence = "hidden";



if (oTopSubform.CheckBox3.rawValue == 1)

form1.Page1Subform.OptionalSubform2.presence = "visible";

else

form1.Page1Subform.OptionalSubform2.presence = "hidden";



if (oTopSubform.CheckBox4.rawValue == 1)

form1.Page1Subform.OptionalSubform3.presence = "visible";

else

form1.Page1Subform.OptionalSubform3.presence = "hidden";



if (oTopSubform.CheckBox5.rawValue == 1)

form1.Page1Subform.OptionalSubform4.presence = "visible";

else

form1.Page1Subform.OptionalSubform4.presence = "hidden";



if (oTopSubform.CheckBox6.rawValue == 1)

form1.Page1Subform.OptionalSubform5.presence = "visible";

else

form1.Page1Subform.OptionalSubform5.presence = "hidden";

}



The first 3 subforms work perfectly, the last 3 seem to be somewhat triggered by the first check box. Ive tried everything I can think of help please.



V. LiveCycleDesigner8



Thanks. Marlene
1 Reply

Avatar

Level 2
Thanks, but I got it.



I needed to have the following entered on "click" for each checkbox.



ScriptObject.ShowOptionalPart();