Welcome to the LimeSurvey Community Forum

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

If respondents enter wrong token code -> "Please try again" + token form ?

  • socius
  • socius's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 9 months ago - 5 years 9 months ago #171131 by socius
Hi everybody,

edit: sorry - this post appears in the wrong forum (should be in "Can I do this with LimeSurvey?" but I clicked too fast)

I just noticed, that my survey is quite unfriendly. For my survey I send out a printed letter with the link to the survey and the token code. Respondents that enter the link see this page:



If they enter the code correctly they enter the survey - perfect. But if they make a mistake typing the code (which is not unlikely with randomly generated codes like that) they see the following page - and get stuck.





The problem is: in this situation there seems to be nothing they can do - no "Maybe there was a typo, please try again" - the Input form is gone. It is also not possible to go back via Browserbutton (for a "Go back and try again" message). It seems to me that the respondents who entered the code incorrectly are stuck here - and I fear that they would not try again (enter the link again, etc.).

Is there a way to make this more easy and friendly? It would be just fine, if the form did not disappear the error message was friendly and the respondents could try again. That would be great. Anybody knows how to achieve this? I'd really appreciate that.

Thanks a lot for your time and all the best,
G

PS: I still use LS 2.6.7LTS
Last edit: 5 years 9 months ago by socius. Reason: Added LS version used, edit: sorry - this post appears in the wrong forum
The topic has been locked.
  • socius
  • socius's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 9 months ago #171133 by socius
Hi everybody,

I found an easy solution with the help of @Denis: www.limesurvey.org/forum/can-i-do-this-w...uthentication-copied

Just put a link back into the error message (s. below). That might not be as elegant as the error message and the form asking for the token again, but it's an easy one. Do not forget "newtest/Y" in the link.

Code:
$(document).ready(function(){
    if (typeof tokenlabel === "undefined"){
        tokenlabel ="YOUR TOKEN LABEL : ";
    }
    if (typeof tokentext === "undefined"){
        tokentext ="YOUR TOKEN TEXT DESCRIPTION";
    }
    if (typeof tokenerror === "undefined"){
        tokenerror ="<br><br><strong class='error'>YOUR ERROR MESSAGE with <a href=https://www.surveyurl.com/index.php/SURVEYSID/newtest/Y#>LINK BACK</a></strong>";
    }
 
   if ($("#tokenform").length )
   {
        $("#tokenmessage").html(tokentext);
        $("label[for='token']").text(tokenlabel);
   }
   else
   {
       $("#tokenmessage").html(tokentext+tokenerror);
   }
 
});


Thanks for reading!

Best,
G
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171139 by DenisChenu
See bugs.limesurvey.org/view.php?id=13580

Previously : we have the link to try again.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • socius
  • socius's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 9 months ago #171160 by socius
Hi Denis,

thanks for your response! In my case this is not a problem of an expired session, but if respondents enter the token incorrectly (I use LS 2.6.7LTS). There is no link (as far as I can see) that would bring the respondents back to the form where they can enter the token again.

I'm satisfied with my solution so far, i.e. the code you provided and I complemented with a link.

Thanks and all the best,
G
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171161 by DenisChenu
About the token : i think there was a link in 3.0 alpha version. If we have one in session : it's easy to jhave one in bad token :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: socius
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose