Timed custom message | Experience Community
Skip to main content
Solved

Timed custom message

  • Mar 13, 2018 8:05 PM UTC
  • 7 replies
  • 185 views

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 ●●●●●●●●
  • Mar 13, 2018 8:23 PM UTC
Yes, you can use a JavaScript with a setTimeout function to unhide a hidden <div> in your question text.

  • Author
  • Mar 13, 2018 8:31 PM UTC
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 ●●●●
  • Answer
  • Mar 13, 2018 8:44 PM UTC
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
  • Mar 13, 2018 9:22 PM UTC
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 ●●●●
  • Mar 13, 2018 9:24 PM UTC
> @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
  • Mar 13, 2018 9:26 PM UTC
Wow, yes, that worked! Thanks so very much!

  • Oct 22, 2021 7:16 PM UTC

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!!!