Skip to content Skip to sidebar Skip to footer

Delay Display Of Text In Qualtrics Using Javascript

(This is related to the unanswered question https://stackoverflow.com/questions/26745762/delaying-presentation-of-text-in-qualtrics) I am working on a Qualtrics survey. I want to d

Solution 1:

You're making it more complex than need be.

Here is example html for the question:

This is a question. <span id="hiddentext" style="display:none">This text 
will display after five seconds.</span>

Here is the javascript for the question:

Qualtrics.SurveyEngine.addOnload(function()
{
    setTimeout("$('hiddentext').style.display = 'inline'",5000);
});

Solution 2:

This hides the radiobuttons or Choices in a multiple choice question for 2 seconds. If you need to hide the next button as well you can add a Timing question from the ones already provided in Qualtrics and set it to "Enable submit after (seconds)".

Qualtrics.SurveyEngine.addOnload(function() {
varQID = this.questionId;
console.log(QID);
for (var i = 1; i < 4; i++) {
    document.getElementById( QID + "-" + i + "-label" ).style.display="none";
}


(function(delay_container){
    for (var i = 1 ; i < 4 ; i ++){
        document.getElementById(QID + "-" + i + "-label").style.display="block";
    }
}).delay(2,this.questionContainer);
});    

Let's say you have two sentences that are two separate Descriptive text boxes. And you want the second box to appear some seconds after the first. The following worked for me when assigned for the second box. The same code works for following boxes as well. You can again put a Timing question at the end of the page to hide Next button.

Qualtrics.SurveyEngine.addOnload(function() {
varQID = this.questionId;
console.log(QID);
for (var i = 1; i < 4; i++) {
    document.getElementById( QID).style.display="none";
}


(function(delay_container){
    for (var i = 1 ; i < 4 ; i ++){
        document.getElementById(QID).style.display="block";
    }
}).delay(2,this.questionContainer);


});

Post a Comment for "Delay Display Of Text In Qualtrics Using Javascript"