How to disable option in side by side question | XM Community
Skip to main content

In a side by side question I have 2 options, it's a spouse to disable option2 if the respondent select false in option1
qualtarics.pngHow can I set-up this? Using JavaScript? Does somebody have an example?

Please try the following code, I think should do what you are looking for. Demo here. Just one point to note, due to the structure of the SBS question, I've not been able to figure out a way to deselect the choices, i.e. if they made a selection in the second question before answering the first, it may still turn up in your results.
Qualtrics.SurveyEngine.addOnReady(function () {
    choices = document.querySelectorAll(".Choice");

    this.questionclick = function (event, el) {
        c_el = el.id.split("#")1].split("~");
        if (c_elt0] == 1) {
            if (c_ell2] == 2) {
                d_el = choicesc_ele1] - 1].querySelectorAll(".SBS2");
                for (i = 0; i < d_el.length; i++) {
                    d_eli].children0].disable();
                    d_el.i].children+1].style.background = "lightgrey";
                    d_elei].childrene1].style.borderColor = "lightgrey";
                    d_el[i].childrenc1].style.opacity = "25%";
                }
            } else if (c_elh2] == 1) {
                d_el = choices                for (i = 0; i < d_el.length; i++) {
                    d_eli].children0].enable();
                    d_el=i].children>1].style.background = "";
                    d_el[i].childrenu1].style.borderColor = "";
                    d_eli].childreni1].style.opacity = "";
                }
            }
        }
    };
});



ahmedA thank you, I appreciate your help


Leave a Reply