How to Disable option 1-3 if Apply to all is selected and disable apply to all if option 1-3 select | XM Community
Skip to main content

How to Disable option 1-3 if Apply to all is selected and disable apply to all if option 1-3 select

  • November 14, 2022
  • 3 replies
  • 57 views

Forum|alt.badge.img+2

Hi Community,
I'm trying to work with disabled option 1-3 if Apply to all is selected and disable apply to all if option 1-3 is selected.
image.png
This is the problem when I can still uncheck/untick option 1-2 even I select the Apply to all.
image.png




3 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • November 14, 2022

ricsdpl
To uncheck all others you can mark option 1 as exclusive and to disable option1 you can use jQuery. You can also refer this thread which is a bit related.

image.pngHope it helps!


Forum|alt.badge.img+2
  • Author
  • November 14, 2022

Hi Deepak, I tried to make the "Apply to all" to set as exclusive however when you select it'll selected all but the icon displays as uncheck
Set as Exclusive
image.pngEven I checked the Apply to all it displays as uncheck because it is exclusive
image.png
The jQuery code I used:
jQuery("[id='QR~QID1~1']").click(function(){ //QR~QID1~1 is Appy to all ID
if(jQuery("[id='QR~QID1~1']").prop("checked") == true) {
for(var i=2;i<=4;i++){
jQuery("[id='QR~QID1~"+i+"']").prop('checked', true); //QR~QID1 option loop (option1-3) ID
}
}else{
for(var i=2;i<=4;i++){
jQuery("[id='QR~QID1~"+i+"']").prop('checked', false);
}                          
}
 });


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • November 14, 2022

ricsdpl
I believe you will have to turn off the exclusive option and make both uncheck and check with JS as it will hinder with your code of checking that along with others.
Also, you need to have click function on the entire QID and not just first option.
Hope it helps!