Hi! I have a question that is hidden and has page breaks on both ends, like so:
Question 1
Page break 1
Question 2 (Hidden using code below)
Page break 2
Question 3
This works great when you are moving forward through the survey. However, if you want to move backward, from Question 3 to Question 1, you're not able to. You end up going back to Question 2 which automatically sends you forward to Question 3. Is there any way for respondents to be able to go back from Question 3 to Question 1 if they want? For example, can the back button send a participant back 2 pages, instead of just one? (Note: The JS below is copied from various searches. I don't know JS yet.) Thanks!!!!
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).hide();
jQuery('.QuestionOuter').css('visibility','hidden')
jQuery('#Wrapper').css('visibility','hidden');
jQuery('#Wrapper').css('opacity','0');
});
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery('#NextButton').click();
jQuery('#Wrapper').css('visibility','hidden')
});
Solved
Is it possible have back button send participant back 2 pages?
Best answer by ahmedA
Add this to the top (outside all the Qualtrics....) of your JS in the first question.
var double_back;
Change the onReady method of the second question to this:
Qualtrics.SurveyEngine.addOnReady(function () {
if (double_back) {
double_back = 0;
jQuery("#PreviousButton").click();
} else {
jQuery("#NextButton").click();
}
jQuery("#Wrapper").css("visibility", "hidden");
});
Add this to your third question JS:
Qualtrics.SurveyEngine.addOnReady(function () {
jQuery("#PreviousButton").click(function () {
double_back = 1;
});
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
