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.

Multiple checkboxes controlling same subform reveal - problem when unchecking box

Avatar

Former Community Member
I'm working in LiveCycle Designer 8.0 and I have multiple checkboxes that reveal the same subform (ex: checkboxes 1, 3, 5 reveal subforms 1 & 3; checkboxes 2, 4, 6 reveal subforms 1 & 4). The user only needs to complete the info once and has the potential to select multiple checkboxes that need the same subform completed. I have multiple other checkbox options that do not need the subforms revealed, or I would leave the subforms as static parts of the form.



I want the 'revealed' subform to go away if the user unchecks a box. I have the following JavaScript in the change event of each checkbox:



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



My problem is that checking two (or more) boxes that point to the same subform and then unchecking any one will hide the common subform even though the other checkboxes remain checked. I really want to leave the subform visible as long as one box is checked that calls for that subform to be revealed.



Any idea how I might accomplish this?



Thanks!



Andi
2 Replies

Avatar

Former Community Member
Hi Andi,

You can check the other checkbox values (1,3) while on the change event of main checkbox (5). So your script can be as:



form1.BookingForm.Editions.CheckBox5::change - (JavaScript, client)

if(CheckBox5.rawValue == "0" && CheckBox1.rawValue == "0" && CheckBox3.rawValue == "0")

subform1.presence = "hidden";

else

subform1.presence = "visible";



You must put this script to 3 checkboxes change events.



In case of enterprise level solutions and strict deadlines of form designs, you can contact me to get consultancy.



asiyegunaydin@kgc.com.tr

Asiye