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 visible 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 the subform hidden instead of visible), and trying different default values for the checkbox. No matter what I try, the subform is ALWAYS visible when the form is opened.
I can hide the subform only by MANUALLY either unchecking the checkbox (if it is initially checked) or checking and then unchecking the checkbox (if it is initially unchecked).
Note: The above behavior is what I see either when I "Preview PDF" from LifeCycle Designer or when I open the form in Acrobat Reader.
Thanks.