Timed custom message | XM Community
Skip to main content
Solved

Timed custom message


Does anyone know if there is a way to set up a timer so that the respondent gets a message after X minutes spent on a question? I have a question that auto advances after 20 minutes but I'd like to be able to have a message pop up after 15 minutes telling them they have 5 minutes left. Thanks!

Best answer by AnthonyR

Assuming you actually want a popup, you could use an alert instead of unhiding a div. Add the following to the addOnReady section of the javascript for this question. setTimeout(function(){ alert("This is your message"); }, 900000); //900000 ms is 900 seconds or 15 minutes
View original

7 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5938 replies
  • March 13, 2018
Yes, you can use a JavaScript with a setTimeout function to unhide a hidden <div> in your question text.

  • Author
  • 3 replies
  • March 13, 2018
Thanks so much Tom! I'm completely new to coding and trying to set this up. Would you be able to actually show me how the code should be written?

AnthonyR
Level 4 ●●●●
Forum|alt.badge.img+7
  • Level 4 ●●●●
  • 306 replies
  • Answer
  • March 13, 2018
Assuming you actually want a popup, you could use an alert instead of unhiding a div. Add the following to the addOnReady section of the javascript for this question. setTimeout(function(){ alert("This is your message"); }, 900000); //900000 ms is 900 seconds or 15 minutes

  • Author
  • 3 replies
  • March 13, 2018
Thanks so much Anthony. This works great. Only problem is that after I click 'close', the alert message appears a second time. So a respondent would have to close it twice. Do you know why that might be?

AnthonyR
Level 4 ●●●●
Forum|alt.badge.img+7
  • Level 4 ●●●●
  • 306 replies
  • March 13, 2018
> @ylit said: > Thanks so much Anthony. This works great. Only problem is that after I click 'close', the alert message appears a second time. So a respondent would have to close it twice. Do you know why that might be? This is because of the mobile preview, if you view a non-preview link, you will see it is not a problem!

  • Author
  • 3 replies
  • March 13, 2018
Wow, yes, that worked! Thanks so very much!

  • 1 reply
  • October 22, 2021

I added this JS and it worked BEAUTIFULLY online. However, when I deploy the survey on the offline Qualtrics App, I no longer see the pop-up. Is there a way to fix that? Thank you!!!


Leave a Reply