Allow to pass page if two out of two checkboxes are selected | XM Community
Solved

Allow to pass page if two out of two checkboxes are selected


Hi all, I am writing a consent form in the beginning of the survey and I want the participants to check two cheekbones. If they don't select both of them, the can't pass page (similar to a force response). I don't want to send them to the end of the survey, I just want to not allow them to pass the page. I have the following html for the two checkboxes.











I have been looking codes on the internet but no-one works for me. Can anyone help me please?

Thank you!

icon

Best answer by rondev 13 May 2020, 23:15

View original

4 replies

Userlevel 7
Badge +22

Any reasons why are we not using qualtrics multi choice question with two options, and then adding custom validation to it.

I am using that option currently, but I just wanted to know this other option too. I basically want the consent form to resemble to the typical one where you have Accept Terms and Conditions checkboxes.

Userlevel 7
Badge +22

Paste the below code in the descriptive text question JS onReady part:
var that =this;
that.disableNextButton();
jQuery("#"+that.questionId+" input[type='checkbox']").on('click',function(){

if(jQuery("#agree1").prop("checked") && jQuery("#agree2").prop("checked"))
that.enableNextButton();
else
that.disableNextButton();

});

Thanks a lot! I tried it and it works perfectly! Thank you!

Leave a Reply