Welcome to the LimeSurvey Community Forum

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

Prevent accidentially closing the survey

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago #107456 by DenisChenu
Replied by DenisChenu on topic Prevent accidentially closing the survey

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.
More
9 years 11 months ago #107466 by david2013
Replied by david2013 on topic Prevent accidentially closing the survey
It seems it will jump to next compulsory question. If I have 50 questions on 50 different pages. Each question are compulsory. Now I want to test skip logic around Q40. Currently, I have to answer all the questions up to Q40. Are we able to let question index jump to Q40 directly? It will save a lot of time when testing.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 11 months ago #107467 by DenisChenu
Replied by DenisChenu on topic Prevent accidentially closing the survey
No .... stop at first error, but don't stop at actual page.

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.
  • jonsen
  • jonsen's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 10 months ago #107913 by jonsen
Replied by jonsen on topic Prevent accidentially closing the survey
Denis, thanks again for your solution! The reason why it did not work for me was that I changed the wrong template - d'oh! ;)

But I have one (I think quite important) addition to your code. In order for participants to be able to leave the survey without a message AFTER completing, I added another condition to the if-statement:
Code:
if(!$('#submitted').length && !$('#completed').length)
(It detects if the div with the id "completed" exists on that page.)

If you agree, can you please add it to your code?

Best
Jonsen
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 10 months ago #107915 by DenisChenu
Replied by DenisChenu on topic Prevent accidentially closing the survey

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: jonsen
The topic has been locked.
  • jonsen
  • jonsen's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 10 months ago #107916 by jonsen
Replied by jonsen on topic Prevent accidentially closing the survey
I edited your post in the wiki...

Thanks and see you!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 10 months ago #107917 by DenisChenu
Replied by DenisChenu on topic Prevent accidentially closing the survey
And maybe it's best to use something like this:
Code:
if(!$('#submitted').length || $('.button,[name='move']').length)

Think it's best (have to test ...)

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.
  • jonsen
  • jonsen's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 10 months ago #107997 by jonsen
Replied by jonsen on topic Prevent accidentially closing the survey

DenisChenu wrote:

Code:
$('.button,[name='move']').length


Yes, that's probably better than finding it out based on the <div>. I'm not sure if that then covers all cases...
The topic has been locked.
More
9 years 7 months ago #111049 by LS_SR
Replied by LS_SR on topic Prevent accidentially closing the survey
Where can I change the alert text and the alert-button text?

I tryed the program Poedit, but that's not working.
The topic has been locked.
  • jonsen
  • jonsen's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #111050 by jonsen
Replied by jonsen on topic Prevent accidentially closing the survey
Hi LS_SR,

you can adapt the German sentences in the code (at e.returnValue and return) BUT for Firefox and similar browsers, the text is built-in and you cannot change it. You would need to rewrite the function for Firefox. Also, you cannot change the text of the button of javascript's alert() function, so you would have to use a differnet solution to implement an alert with a custom button, like using jQuery's alert functions...

Best
jonsen
The following user(s) said Thank You: LS_SR
The topic has been locked.
More
9 years 7 months ago #111051 by LS_SR
Replied by LS_SR on topic Prevent accidentially closing the survey
Thanks for your fast answer.
The topic has been locked.
  • Taereian_43648
  • Taereian_43648's Avatar
  • Visitor
  • Visitor
9 years 2 months ago #116036 by Taereian_43648
Replied by Taereian_43648 on topic Prevent accidentially closing the survey
Thanks a lot for your Code.
Do you now how it's possible to make en exception for the languagechanger?

Cheers
Benny
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose