Disabling "Next" doesn't work when there's a Timing question in the same page. | XM Community
Skip to main content
Solved

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

  • July 23, 2021
  • 5 replies
  • 145 views

Forum|alt.badge.img+2

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 by rondev

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);

5 replies

Forum|alt.badge.img+2
  • Author
  • July 23, 2021

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.




Forum|alt.badge.img+2
  • Author
  • July 23, 2021

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


rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • July 23, 2021

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);


Forum|alt.badge.img+2
  • Author
  • July 26, 2021

Thanks for the workaround, rondev!


Forum|alt.badge.img+5
  • Level 2 ●●
  • July 1, 2022

rondev Hi, rondev. Could you please specify whether should I put the code you provided? I have tried the three parts of the javascript of the timing question, but none of them worked...