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.
This is the problem when I can still uncheck/untick option 1-2 even I select the Apply to all.
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.
Hope it helps!
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
Even I checked the Apply to all it displays as uncheck because it is exclusive
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);
}
}
});
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!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.