Expand my Community achievements bar.

Hiding subform when form is opened

Avatar

Level 1

I have the following javascript associated with a checkbox and a subform:

form1.SHCognitionCheckBox::change - (JavaScript, client)

if

(this.rawValue == 1)

  CognitionBehaviorSubformCheckBoxes.presence

= "visible";

else

  CognitionBehaviorSubformCheckBoxes.presence

= "hidden";

My intention is to make the subform visible only when the checkbox is checked.

If the checkbox is MANUALLY checked or unchecked, the subform becomes visisble or hidden, as expected.

HOWEVER, whenever a previously saved form is initially opened, the subform is ALWAYS VISIBLE, regardless of whether the checkbox is checked or unchecked.

Is there a way to cause the subform to be HIDDEN when the form is opened with the checkbox unchecked?

I have tried different approaches: reversing the logic (checking the checkbox to make it hidden instead of visible), and trying different default values for the checkbox. No matter what I try, the subform is ALWAYS open when the form is opened.

I can close the subform only by MANUALLY either unchecking the checkbox (if it is initially checked) or checking and unchecking the checkbox (if it is initially unchecked).

Thanks.

2 Replies

Avatar

Level 1

I am having the same problem. I have subforms that are orginally "hidden", and become "visible" when an item in a drop down menu is selected. When I save the form, and re-open it, the subforms are hidden again.

Did you find a solution?

Avatar

Level 1

I have the same problem..... Can anyone give solution for this.