Matrix dynamic pop up | XM Community
Solved

Matrix dynamic pop up

  • 15 April 2024
  • 6 replies
  • 44 views

Badge +1

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)?

 

 

icon

Best answer by omkarkewat 16 April 2024, 19:22

View original

6 replies

Userlevel 4
Badge +12

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(); 
    };
});

 

Badge +1

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. 

Userlevel 4
Badge +12

 @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. 

Badge +1

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?

Userlevel 4
Badge +12

@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).

Badge +1

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

Leave a Reply