How to add an 'exit survey' button at the end of each page that takes participants to end of survey? | XM Community
Skip to main content

I tried the Javascripts but they do not work now. Anyone knows how I can do this? 

Thanks!

I would see this done in one of two ways.

  1. Use the Table of Contents feature. This would allow the user to jump to the end on their own, but I’m not sure if that is what you want.
  2. Place a multiple choice question in each block, that has just one option, and call it “End Survey” or similar. Then either use the survey flow to check if the button has been pressed and skip the next blocks, or use the Skip Logic for any additional question. That would get you to the end of the survey.

The cases above would not requite any JavaScript, but would require that the click on the question button and then the next button. If you add the below JavaScript to the same button, then the Next button will be clicked automatically when you click the “End Survey” button:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});


Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.


Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.

Hi,
I am interested in doing exactly the same thing.

How would you implement your suggestion please?


Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.

I tried doing that, but Qualtrics did not like it. Did you use the html <> button?


I would see this done in one of two ways.

  1. Use the Table of Contents feature. This would allow the user to jump to the end on their own, but I’m not sure if that is what you want.
  2. Place a multiple choice question in each block, that has just one option, and call it “End Survey” or similar. Then either use the survey flow to check if the button has been pressed and skip the next blocks, or use the Skip Logic for any additional question. That would get you to the end of the survey.

The cases above would not requite any JavaScript, but would require that the click on the question button and then the next button. If you add the below JavaScript to the same button, then the Next button will be clicked automatically when you click the “End Survey” button:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});

Thank you! I ended up adding a question at the end of each block. If I wanted to add the end survey button, where would you paste the code? On the html <>?


Hi @Culturelab

I’m not 100% sure what you mean?

This code:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});

Would be added in the JavaScript section of the “End Survey” button. It would be activated when you click on the “End Survey” button, and the code would then activate the Next/Submit button, so you do not have to click the End Survey and then the Next button.


Leave a Reply