I'm trying to allow for participants to press one of two buttons to answer a two-option question in my Qualtrics survey, and automatically advance to the next page. I'm using the code below. When I try it out, pressing "j" and "k" work for answering the question and advancing to the next page. But the "Next" button still shows on the page. How do I hide the "Next" button? That part of the code doesn't seem to be working.
I want the page to look like this: https://survey.qualtrics.com/jfe/form/SV_0xhfEoQxMvScnYM?SVID= with no "Next" button. Thank you for your help!
Qualtrics.SurveyEngine.addOnload(function()
{
this.hideNextButton();
this.hidePreviousButton();
var that = this;
Event.observe(document, 'keydown', function keydownCallback(e) {
var choiceID = null;
switch (e.keyCode) {
case 74: // 'j' was pressed
choiceID = 1;
break;
case 75: // 'k' was pressed
choiceID = 2;
break;
}
if (choiceID) {
Event.stopObserving(document, 'keydown', keydownCallback);
that.setChoiceValue(choiceID, true);
that.clickNextButton();
}
});
});