Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Multi subforms on 1 page - make 1 subform hidden

Avatar

Former Community Member
Good Day

I would be a wee bit new at this so it might sound like a silly question.



I have designed a form that is approx 3 pages in length when all subforms are visable. When I tried to hide 1 subform on a page (using a check box) the whole page (3 subforms) became hidden. Is there a way to only hide or make visable 1 subform if there are multi subforms on a single page?



Regards



Don
3 Replies

Avatar

Former Community Member
Make sure that you are changing the presence property on the subform that you want to hide only.

Avatar

Former Community Member
Thanks Paul;

The code I am using on the Checkbox is as follows



if (CheckBox1.rawValue == true)

Subform2.presence = "visible";

else

Subform2.presence = "hidden";



There are a 4 checkboxes that depending if they are selected will make visable the corresponding subform.



Regards



Don

Avatar

Former Community Member
Add an app.alert(CheckBox1.rawValue) before the if statement to ensure that you are getting back what you think you are.



Also make sure you are rendering as a dynamic form