Delaying a question from appearing? | XM Community
Skip to main content

Delaying a question from appearing?


Forum|alt.badge.img+2

This question was posted and answered in the community page six years ago.  I tried the JavaScript provided by AnthonyR below, but it doesn’t seem to be working for me.  I don’t know if there is something within Qualtrics that has changed in that time frame that wouldn’t allow this to work?  Any ideas?

 

Is there a way for me to delay a question from appearing? I have a video that I would like the respondent to watch for 30 seconds before a question appears right below it on the same page.

icon

Best answer by AnthonyR

Add the following JavaScript to the question you would like a delayed:

Qualtrics.SurveyEngine.addOnload(function()
{
this.getQuestionContainer().hide();

});

Qualtrics.SurveyEngine.addOnReady(function()
{
var delayTime = 30000 //This is the time of delay
var that = this;
setTimeout(function(){that.getQuestionContainer().show()}, delayTime);

});

The timing can be updated by updating the value of delayTime, which is set in milliseconds.

2 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2031 replies
  • March 7, 2024

The should be fine. I believe the issue is that the question is not fully loaded and therefore not hidden when you call it from addOnload. Try this:

Qualtrics.SurveyEngine.addOnReady(function () {
	this.getQuestionContainer().hide();
	var delayTime = 30000; //This is the time of delay
	var that = this;
	setTimeout(function () {
		that.getQuestionContainer().show();
	}, delayTime);
});

 


Forum|alt.badge.img+2
  • Author
  • Level 1 ●
  • 3 replies
  • March 7, 2024

Thanks so much!  That still isn’t working.  I must be missing something else as it seems this code should definitely work. 


Leave a Reply