Ask the community, share ideas, and connect with other LimeSurvey users!
Sorry for confusion. You're right. I mean the response ID.tammo wrote: The surveyID is always the same when coming from survey1 (it is 111111). Do you mean the response ID, or am I missing something?
/* * *TOKEN REDIRECT * */ $(document).ready(function() { // Define the new message var redirect_text = 'Attendi mentre carichiamo le tue risposte.<br><img src=\"https://www.tbaf.org.tw/event/2016safe/imgs/loader1.gif\">'; // Insert the new message if($('#tokenmessage').length > 0) { if($('#tokenform').length > 0) { /*token messagge in ingresso, identifica la form dove inserire i numeri*/ } else { $('#tokenmessage').html(redirect_text); var url = "URL"; url += findToken(); //helper function to extract the token url += "/newtest/Y/lang/it"; //alert(url); window.location.replace(url); } } });
The redirection itself can be seen as an invalid action by security settings in the browser or antimalwaresecurity software. So you never have 100% when using survey redirection.Liod_DS wrote: Sometimes (I think 1 of 200-300 cases) a user can't get to the part2, and he remains stuck between the two surveys...did it happen to you too?
Thanks for the insight. Wonder if this script really copes with all situations then.tpartner wrote: Checking for the length of #tokenmessage and #tokenform tests to see if this is the token entry screen - these are elements found only in that screen.
/* funzione ad hoc per il recupero del token*/ function findToken() { var sPageURL = window.location.href; // alert(sPageURL); var sURLVariables = sPageURL.split('/'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i]; if (sParameterName == "token") { return sURLVariables[i+1]; } } }