How to add timing to submit "Form" in text answer? | XM Community
Skip to main content

I am not new to Qualtrics, but am not versed in JS. I have a block with several form answers (response not required) that I would like to have autosubmit after so many seconds following the start of an audio file (total 20 files). I have looked here and followed the pages they cited, but I do not know enough JS to be able to parse out what I need (I'm working on learning) or make changes to the code. Would prefer only one visible at a time. In other words, Form 1, shows for 7-10 seconds, then Form 2...etc through Form20. Then block is over.
TLDR: I need 20 forms within one text answer to submit after approximately 7-10 seconds each, consecutively over 2.5 minute length (can be blank).

so I decided to use 20 separate forms. Not the same, but effective


If it's just about timing, you can use the following code.
Qualtrics.SurveyEngine.addOnload(function()
{
this.getQuestionContainer().hide(); // Hide the question as soon as the page loads


});


Qualtrics.SurveyEngine.addOnReady(function()
{

var showTime = 6000 //This is the delay time
var that = this;
setTimeout(function(){that.getQuestionContainer().show()}, showTime); // Function to show the question



});

Change it according to when you want each question to show up and disappear.
So, for example, your first question will not have the hide() function in the addOnload function, and will be used in place of the show() function.
For all other questions, you'll have to hide them at addOnload, then show them after a certain amount of time. Then hide them again.


Leave a Reply