Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Show/hide subform using a checkbox - PLEASE HELP

Avatar

Former Community Member

Hi guys,

I am fairly new to Adobe Livecycle and javascript in general. I am trying to create a form that has multiple checkboxes. Once a checbox is selected, I want to show a subform. If that checkbox is not selected, I want that subform to be hidden.

Under the click event for the checkbox, I have tried the following:

if (this.rawValue == 1)
{
CheckBox1.presence = "visible";
}
else
CheckBox1.presence = "invisible";
}

I also do not want the subforms to be displayed when the form is opened up, only when the checkbox is clicked.

THIS IS NOT WORKING. PLEASE HELP!!

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

Use formcalc:

On Click event                 

if ($.rawValue==1)then
subformname.presence="visible"
else subformname.presence="hidden"
endif

View solution in original post

3 Replies

Avatar

Former Community Member

Then you will have the same code under docReady event of the checkbox as well.....that should do the trick.

Avatar

Former Community Member

Nope Adobe Livecycle Design stopped working when I added that code into the docReady event for the checkbox.

Did I mention that I am using Version 7.0? Not sure whether that makes a difference.

In any case any suggestions in terms of coding to get what I want working??

Avatar

Correct answer by
Level 6

Use formcalc:

On Click event                 

if ($.rawValue==1)then
subformname.presence="visible"
else subformname.presence="hidden"
endif