Welcome to the LimeSurvey Community Forum

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

Redirect Url after self-registration for a new registration on a public desk

  • arioli
  • arioli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #124440 by arioli
Hi all.

I want to provide a public desk with self-registration page for a survey. Once the person has registered (normally), he will get the mail to do the surevy at home when he wants and the thank you for registering page (easy).

My problem is that after the registration thank you page, limesurevy should somehow redirect the browser to go again to a clean self registration page, so that the next person passing by will be able to self register himself... and so on.

How/where can i force a redirect after thank you page for another registration? I tried url redirect, but that is for completed survey not for completed registration. I tried to look into template in register.pstpl, but I cannot add code there before the data are submitted. I do not know how to link this to "thank you registering page" ??

I am not expert, need help !!! Thanks
The topic has been locked.
  • arioli
  • arioli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #124589 by arioli
I found this code ... www.limesurvey.org/en/forum/design-issue...to-url-thanks-screen
But where should I put this to be enabled after the thanks you screen ?? THANKS

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
var url = ' somesurveysite.com/limesurvey//index.php...45&newtest=Y&lang=en ';

setTimeout(function() {
window.location.replace(url);
}, 5000);
});
</script>
The topic has been locked.
  • arioli
  • arioli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #124616 by arioli
SOLVED ...

The thank you page has a URL which is slighlty different than the new registration page it comes from
new registration -> ' www.yourdoman.com/ index.php/1234';
thank you for registration -> ' www.yourdoman.com/ index.php/register/index?sid=1234';

I put in the TEMPKLATE OF THE SURVEY THE following code endpage.pstpsl the following code ...
It's not elegant, but if you need to do it once, it's ok as it applies only to the specific template.

First it gets the current url, if that is the one of the registration thank youpage, then it forces to redirect to the original new registration page it came from so to allow for a brand new registration to another custoemer ... Wait time is msec so 8000 = 8 seconds.

<script type="text/javascript">

var thispageurl =window.location.href;
var newregbaseurl = ' www.yourdoman.com/ index.php/1234';
var regthanksurl = ' www.yourdoman.com/ index.php/register/index?sid=1234';


regconfirmation= thispageurl.localeCompare(regthanksurl);

if(regconfirmation==0){

document.write("This page will go back to REGISTRATION HOME in few seconds");
setTimeout(function() {
window.location.replace(newregbaseurl);
}, 8000);

}
</script>
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose