Disabling "Next" doesn't work when there's a Timing question in the same page.

Bobby
Bobby Community Member Qubie ✭
edited July 30 in Qualtrics API

Hey,

I'm trying to disable the "Next" button for one of the questions in my survey, so that I can later re-enable it once a condition is met.

This usually does the job:

Qualtrics.SurveyEngine.addOnload(function()
{
	this.disableNextButton();
});

Unfortunately, when a timing question is included in the same page (i.e. no page break between the question and the timing question). Disabling the next button doesn't work. However, the timing question must be in the same page in order to time and count the clicks for the regular question ...

I also tried:

  • Using jQuery to disable the button, i.e. jQuery('#NextButton').attr('disabled', true)
  • Adding the disable code to the Javascript of the Timing question.

but to no avail ...


Any help would be appreciated.

Thanks!

Best Answer

  • rondev
    rondev Community Member Wizard ✭✭✭✭✭
    Accepted Answer

    You can disable (hide) the next button using same timing question by adding a max limit on the "show next button after" option. OR Use this code to disable the next button:

    var that = this; setTimeout(function(){ that.disableNextButton(); }, 1000);
    

Answers

  • Bobby
    Bobby Community Member Qubie ✭
    edited July 23

    FWIW I tried it in a new question in a different block and it did work.

    While it still didn't work in a new question in original block.

    So it seems to be related to some setting applied at the block level - but not sure what exactly.

  • Bobby
    Bobby Community Member Qubie ✭

    Seems this is related to having a timing question in the same page.

    I updated the question accordingly.

  • Bobby
    Bobby Community Member Qubie ✭

    Thanks for the workaround, rondev!