Matrix dynamic pop up | XM Community
Skip to main content

Hello - does anyone know if it is possible to program a dynamic pop up if the respondent chooses a particular answer in a matrix question like the one below? For each row if the second option 2 is chosen (Heard of it, never used it)?

 

 

Hi @Geny please try the below code. 
Replace the relevant question ID and answer choice ID along with the required error text message.

Qualtrics.SurveyEngine.addOnReady(function() {
    var relevant_choice = document.getElementById("QR~QID11~1~2"); // Replace this with your question ID and answer choice ID
    relevant_choice.onclick = function(click) {
        var recall = confirm("Error Message"); // Replace this text with your required error message text
        if (!recall) click.preventDefault(); 
    };
});

 


Thank you so much @omkarkewat - do you think you could give me the steps to follow to use the code provided? I am a new user and my programming knowledge is very limited. 


 @Geny On the left hand side of your question you will find an option to add Javascript, see image below. 

 

copy paste the code here.

The code I provided in the above post, you will need to customize it according to your question ID and answer ID. 

”QR~QID11~1~2” targets the question ID 11 and the cell of row 1 column 2. If you want to do it for the whole column 2 then you will need to amend it accordingly. 


Thank you again @omkarkewat I understand now how to generate the pop-up - is there a way to have a dynamic text box appear where the respondent can input commentary?


@Geny you can create a text box question and add ‘in-page’ display logic to appear it dynamically on the same page (NOTE: do not add page break, keep these 2 questions in the same page).


Appreciate all your help @omkarkewat thank you so much!!


Leave a Reply