I am trying in Qualtrics to remove the "Next" button from a single page with several questions with display logic. I can't tell if it is due to display logic, a timer I implemented, or my code for removing the button. I've removed and added each but the problem seems to persist.
Context: I have a Qualtrics quiz. At the start of the quiz, a countdown begins and is displayed at the top of the screen. The countdown persists across pages and does not reset when pages change. Once the countdown counts to 0, it (1) updates an embedded data field (blockTimeFlag) previously set to 0 to 1 and (2) advances to the next page. I have added a display logic condition to all questions in the quiz such that they display if blockTimeFlag == 0. As a result, the participant skips the rest of the quiz and is sent to a post-quiz page (without the display logic) once the countdown runs out because all of the remaining questions and pages are not displayed.
I want to remove the "Next" button only on the last page of the quiz. The last page of the quiz has a hidden timer for the entire page (simply counting how long they spend on the page) and 3 questions with display logic indicating they should only display if blockTimeFlag = 0. In other words, I only want people to see these questions if the countdown has not run out and want the respondent advanced to the next page if the countdown has run out.
I have entered the below Javascript into the JS code box for the timer question on the last page to remove the Next button as suggested in Selectively disabling "Next Button" in Qualtrics for specific questions:
Qualtrics.SurveyEngine.addOnload(function() {
function hideEl(element) {
if($(element)) $(element).hide();
}
hideEl.defer('NextButton');
});
For some reason, every time I make it to the last page of the quiz before the countdown runs out, I still see the Next Button. This is a problem because I want people to not be able to advance beyond the last page of the quiz until the countdown is complete.
Any suggestions?
There have been some changes to Qualtrics since that post. Try this:
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#NextButton").hide();
});