Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Help with Checkboxes!!!!!!!

Avatar

Former Community Member
I have a dynamic form with two checkboxes that in the event click (in Javascript) when checked they make the corresponding subform visible and when unchecked invisible.



The checkbox2 works fine but when I paste the SAME code into the event click of checkbox1 and change the name of the subform I can only click it on and not off! Why is that doing this? Here are the codes:



The one that works:



----- form1.#subform[0].CheckBox2::click: - (JavaScript, client) -----------------------------------



if (this.rawValue == 1)

{

MedSubForm.presence = "visible";

}

else

{

MedSubForm.presence = "invisible";

}



The one that doesn't work:



----- form1.#subform[0].CheckBox1::click: - (JavaScript, client) -----------------------------------



if (this.rawValue == 1)

{

Client.presence = "visible";

}

else

{

Client.presence = "invisible";

}
0 Replies