Prevent accidentially closing the survey

More
3 years 5 months ago #107456 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 5 months ago #107466 by david2013
david2013 replied the 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.

Please Log in to join the conversation.

More
3 years 5 months ago #107467 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 4 months ago #107913 by jonsen
jonsen replied the 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:
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

Please Log in to join the conversation.

More
3 years 4 months ago #107915 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: jonsen

Please Log in to join the conversation.

More
3 years 4 months ago #107916 by jonsen
jonsen replied the topic: Prevent accidentially closing the survey
I edited your post in the wiki...

Thanks and see you!

Please Log in to join the conversation.

More
3 years 4 months ago #107917 by DenisChenu
DenisChenu replied the topic: Prevent accidentially closing the survey
And maybe it's best to use something like this:
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 4 months ago #107997 by jonsen
jonsen replied the topic: Prevent accidentially closing the survey

DenisChenu wrote:

$('.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...

Please Log in to join the conversation.

More
3 years 1 month ago #111049 by LS_SR
LS_SR replied the 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.

Please Log in to join the conversation.

More
3 years 1 month ago #111050 by jonsen
jonsen replied the 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

Please Log in to join the conversation.

More
3 years 1 month ago #111051 by LS_SR
LS_SR replied the topic: Prevent accidentially closing the survey
Thanks for your fast answer.

Please Log in to join the conversation.

More
2 years 8 months ago #116036 by fanepic
fanepic replied the 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

Please Log in to join the conversation.

More
2 years 8 months ago #116038 by jonsen
jonsen replied the topic: Prevent accidentially closing the survey
Hi fanepic,

please try to add ".changelang" to the jQuery "on" action by changing this:
$(document).on('click',".button,[name='move']", ...

to this:
$(document).on('click',".button,.changelang,[name='move']", ...

Please leave a quick comment if this works, otherwise I'll have a closer look.

Best
jonsen
The following user(s) said Thank You: fanepic

Please Log in to join the conversation.

More
2 years 8 months ago #116039 by jonsen
jonsen replied the topic: Prevent accidentially closing the survey

Please Log in to join the conversation.

More
2 years 8 months ago #116042 by fanepic
fanepic replied the topic: Prevent accidentially closing the survey
Thank you jonson works fine.

Do you also now how to make it Multilanguage like only show if it's German?

Regards
fanepic

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now