I have multiple response with below 6 options. Now, I want to auto-select "All of the above" option if a respondent select all the responses.
Brand A
Brand B
Brand C
Brand D
Brand E
All of the above.
Solved
Auto select option in multiple choice question
Best answer by SurajK
Write the below code in adOnReady function,
jQuery('input[type="checkbox"]').change(function(){
if (jQuery('input[type="checkbox"]').eq(0).is(":checked") && jQuery('input[type="checkbox"]').eq(1).is(":checked") && jQuery('input[type="checkbox"]').eq(2).is(":checked") && jQuery('input[type="checkbox"]').eq(3).is(":checked") && jQuery('input[type="checkbox"]').eq(4).is(":checked"))
{jQuery('input[type="checkbox"]').last().prop('checked',true)}
else{jQuery('input[type="checkbox"]').last().prop('checked',false)}
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
