Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Radio Buttons

Avatar

Level 2

I have the following radio button groups.  They are mutually exlisive so you can select either "10 or Less" (Checkbox1) or "More Than 10" (Checkbox2)  and either Yes or No.  Is there any way to set these up to where only the Yes or No beside either Checkbox1 or Checkbox2 can be selected depending on which is selected?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Put the 10 or Less and More than 10 in one group and the Yes and no on line

one in a second group and the yes and no on line 2 in a 3rd group. Then

you woudl have to write code on the exit event of the 1st group that woudl check which one was selected and sim

ply disable the other group. On teh exit event of the views group you coudl write code like this:

if (this.rawValue == "Value for 10 Views or less"){

     Group2.access = "open";

     Group3.access = "readOnly";

} else {

     Group2.access = "readOnly"

     Group3.access = "open"

}

Note that the default for Group1 and 2 shoudl be readOnly so that the user cannot select an option before chosing a Group 1 value

Make sense?

Paul

View solution in original post

4 Replies

Avatar

Correct answer by
Former Community Member

Put the 10 or Less and More than 10 in one group and the Yes and no on line

one in a second group and the yes and no on line 2 in a 3rd group. Then

you woudl have to write code on the exit event of the 1st group that woudl check which one was selected and sim

ply disable the other group. On teh exit event of the views group you coudl write code like this:

if (this.rawValue == "Value for 10 Views or less"){

     Group2.access = "open";

     Group3.access = "readOnly";

} else {

     Group2.access = "readOnly"

     Group3.access = "open"

}

Note that the default for Group1 and 2 shoudl be readOnly so that the user cannot select an option before chosing a Group 1 value

Make sense?

Paul

Avatar

Level 2

That works awesome.  Thank you so much.

Avatar

Level 2

I have another question on this issue.  I have the code below which works great however I was wondering if there was a way to clear either RadioButtonList2 or 3.  If you select 10 Views and then select yes or no and change to More than 10 views the yes or no on the 10 views line is still selected (see below).  Is there a way to clear this?

if

(this.rawValue == 1){

 

RadioButtonList2.access

= "open";

 

RadioButtonList3.access

= "readOnly";

 

}

else {

 

RadioButtonList2.access

= "readOnly"

 

RadioButtonList3.access

= "open"

 

}

 

10 Views.jpeg

 

Avatar

Former Community Member

Sure just set the RadioButtonList rawValue property to "". This will clear the selection.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----