Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

How can you ensure the \'No\' checkbox is hidden, or inactivated, if the \'Yes\' checkbox is selected

Avatar

Not applicable
I have a form where, if one selects the 'Yes' checkbox in response to a question, a new set of questions appears. A different set of questions appears if they select 'No'. However, I want to ensure that they don't select both the 'Yes' and the 'No' checkbox, and both sets of questions appear. How do I set things up so only one checkbox is either inactivated or hidden, if the other is selected?
2 Replies

Avatar

Not applicable
set them up as linked radio buttons. That will ensure when one is checked the other cannot be. However, once one is checked, one or the other must be checked (you cannot clear them unless you clear the form).

Avatar

Not applicable
place this code in the event:change script area:



if (this.rawValue == 1) {



Field1.presence = "hidden";

Field2.presence = "visible";

Field3.presence = "invisible";



}



else {



Field1.presence = "visible";

Field2.presence = "invisible";

Field3.presence = "hidden";

}