Question
How to change the background color for unselected choices?
Hello Qualtrics community,
I use a Multiple Choice question (Multiple Answer) with more than 100 choices. Each subject can only select up to 5 answers. I want to change the unselected choices' background color when a subject selects 5 choices. My code does not work. Only the background color of choices with sepicific ids (id = 2, 5, 6) changed. Is there something wrong?
(In the preview mode, the choices looks like buttons, not checkbox.)
Here is my code:
>if(selectedchoice.length==5){
> jQuery("#"+ this.questionId +" input:checkbox:not(:checked)" ).attr("disabled", true);
>
> var t1 = jQuery("#" + this.questionId + " input:checkbox:(:checked)").attr("id");
> for (var s1=0; s1<t1.length; s1++){
> jQuery("#" + this.questionId + " label.MultipleAnswer:eq(" + t1[s1] + ")").css("background","blue");
> };
>
> }else{
> jQuery("#"+ this.questionId +" input:checkbox:not(:checked)" ).attr("disabled", false);
> };
Thanks very much!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
