Adding withdarw button | XM Community
Solved

Adding withdarw button

  • 9 October 2023
  • 2 replies
  • 142 views

Badge +2

I have added java script, to have a withdraw button at the end of each page. The purpose is that if participants want to withdraw from the study, they can click the button. When participants click the buttons, a question with three options should come up. The withdraw button shows up at the bottom of each screen, but it's not clickable and doesn't pop up the question.

I have added the following code:

Qualtrics.SurveyEngine.addOnload(function() {
$(this.question._$separator).hide();
$(this.questionId).hide();
var that = this;
var endBtn = document.getElementById("EndNow");

function skip() {
    that.setChoiceValue(1, true);
    that.clickNextButton();
};

endBtn.addEventListener("click", skip);
});

icon

Best answer by rondev 10 October 2023, 10:56

View original

2 replies

Userlevel 7
Badge +20

@zaink This is only the JS, what’s your button looks like. Are you adding the button code at footer?

Userlevel 7
Badge +22

Make sure you are adding the button first and then adding events on it.

Leave a Reply