Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Timed redirect

  • Yoomes
  • Yoomes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #143199 by Yoomes
Timed redirect was created by Yoomes
Is it possible to have a timed redirect from public statistics at the end of the survey to the start of the survey? I currently have the stats page as the end url. I know that end url could be used to redirect a user straight to the start, but I'd like to display the stats to the user and then after a few seconds redirect back to start for the next user to do the survey. I have tried to use the submit button to start the timer for the redirect, but nothing I have tried has worked. Is it even possible to do this or will I have to use the end url to just redirect the user back to the start without displaying the statistics?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143206 by tpartner
Replied by tpartner on topic Timed redirect
Try adding something like this to template.js. A timer will start when the stats view is detected.

Code:
$(document).ready(function() {
  if($('table.statisticssummary').length > 0) {
    setTimeout(function () {
      window.location.href = "http://example.com";
    }, 5000);
  }
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Yoomes
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose