How to auto-close survey with 5 second timer upon completion | XM Community
Skip to main content
Solved

How to auto-close survey with 5 second timer upon completion


Sorry I'm not good at javascript but I'm sure this probably is an easy ask, and I cannot find the answer anywhere? Is it possible to auto close the survey flyout window on desktop or mobile devices 5 seconds after completion(just enough time to read the thank you message).

Best answer by tbutler

Create a custom end of survey message, edit the source (looks like a rectangle with <> in it), and add this code after whatever message you want to be displayed: <script> setTimeout(function(){ window.close(); }, 5000); </script> That should wait 5 seconds and then close. If you want to change the amount of time it waits, change `5000` to the amount of time in milliseconds (the amount of seconds you want times 1000). Note that this didn't seem to work for me when I previewed the survey, but it worked when I tested it out on an anonymous link distribution.
View original

4 replies

Forum|alt.badge.img
  • Level 1 ●
  • 5 replies
  • Answer
  • June 19, 2018
Create a custom end of survey message, edit the source (looks like a rectangle with <> in it), and add this code after whatever message you want to be displayed: <script> setTimeout(function(){ window.close(); }, 5000); </script> That should wait 5 seconds and then close. If you want to change the amount of time it waits, change `5000` to the amount of time in milliseconds (the amount of seconds you want times 1000). Note that this didn't seem to work for me when I previewed the survey, but it worked when I tested it out on an anonymous link distribution.

Forum|alt.badge.img+3
  • 16 replies
  • February 26, 2019
Does this logic work for Slider surveys as well? It doesnt seem to work for me. I have successfully applied it to one of my other surveys but does not work on slider survey.

mrlorey80
Forum|alt.badge.img
  • 6 replies
  • June 28, 2024

If we want to to use this code snippet to create a 5 seconds test? how should we modify it?

Action: Question X with an image is displayed for N number of seconds, then moves to the following question.


Forum|alt.badge.img+16

Hi @mrlorey80 ,

 

You may wish to look at this thread which may be useful.


Leave a Reply