0

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();
  }
});
});
Anthony Rivas
  • 952
  • 13
  • 21

2 Answers2

0

Replace

this.hideNextButton();
this.hidePreviousButton();

with

$('NextButton').hide();
$('PreviousButton').hide();
Anthony Rivas
  • 952
  • 13
  • 21
0

The page you show has not change its URL address, so I think this basically is a single page application. If you want to operate in two page, you should add a parameter after each page, and next page get his URL'param to oprate,

Dale
  • 1,613
  • 4
  • 22
  • 42
G.Z.P
  • 11
  • 2