Hi everyone-
I'm looking for a way to hide a Qualtrics footer (which is set up to function as an 'I would like to exit this survey' button) on select pages. For background, the footer is using the following code (found on one of these discussion threads I believe, and without the # symbols):
<#button id= "EndNow" name="EndNowBtn" title="EndNow" type="button">I would like to exit this survey#</button>
I'm getting the button to work as I would like by adding questions at the end of pages that are hidden by Javascript (found on the same thread):
Qualtrics.SurveyEngine.addOnReady(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);
});
I'm using an 'End of Block' Skip Logic on these questions and directing to customised End of Survey messages through the Survey Flow, all done to ensure ethical requirements from the university are met. For the most part, this is working well.
The problem, however, is that there are a few other questions that have Skip Logic, as participants need to be screened for eligibility. These questions are automatically on a page of their own, and try as I might, I cannot add one of the Javascript questions onto them to ensure the button still works correctly, as the hidden question is then also automatically given its own page. Meaning the survey now has pages on which the button doesn't work, or worse, somehow serves to get participants to the next page rather than exiting them out of the survey as indicated by the button.
Is there any way to hide the footer (button) on these pages / Skip Logic questions that allows me to avoid the problem of a dysfunctional button?
Solved
Hiding withdraw/exit survey button (footer) from select Qualtrics pages using Javascript
Best answer by TomG
Add this JS to one of the questions on a page where you want to hide the button:
```
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#EndNow").hide();
});
```
View original```
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#EndNow").hide();
});
```
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.