Labels visible on buttons but buttons not viewable or clickable for 2 seconds? | XM Community
Skip to main content

Hi All,
In Javascript, I am looking for the option to have buttons whose labels are viewable but the button itself is both hidden and not clickable for the first 2 seconds and then after 2 seconds the button appears and is clickable. Is this possible?
Thanks for your help!

Hi there, I found some threads that I think might help get you started. I also put their solutions into a QSF for you to reference, and am including the code below as well.
One option is use 2 questions to implement - 1 that is a Text/Graphic and just displays information to the respondent (to display labels), and the 2nd question is the clickable question which is entirely hidden until 2 seconds after page load. The code to delay the appearance of an entire survey question is below:
Qualtrics.SurveyEngine.addOnload(function()
{
    this.getQuestionContainer().hide();


});


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


});
https://community.qualtrics.com/XMcommunity/discussion/82/how-can-i-delay-a-question-from-appearing

A 2nd option is a little closer to what you initially described. It includes a delay for displaying the buttons but I wasn't sure how to make them not clickable. It uses a matrix question and the below code to delay the appearance of the radio buttons:
Qualtrics.SurveyEngine.addOnload(function()
{
    this.getQuestionContainer().querySelectorAll("eclass^='q-']").forEach(button => button.hide());


});


Qualtrics.SurveyEngine.addOnReady(function()
{
    var delayTime = 2000 //This is the time of delay
    var that = this;
    setTimeout(function(){that.getQuestionContainer().querySelectorAll("qclass^='q-']").forEach(button => button.show())}, delayTime);  


});
https://community.qualtrics.com/XMcommunity/discussion/14423/hide-all-radio-buttons-with-custom-code
QuestionsTimedDisplay.qsf


Leave a Reply