- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
function goodbye(e) { if(!$('body', top.document).hasClass('submitted')) { //check if a button was used to navigate or the survey is completed if(!e) e = window.event; //e.cancelBubble is supported by IE - this will kill the bubbling process. e.cancelBubble = true; e.returnValue = 'Are you sure you want to quit this survey?'; //This is displayed on the dialog for IE //e.stopPropagation works in Firefox. if (e.stopPropagation) { e.stopPropagation(); e.preventDefault(); } return 'Are you sure you want to quit this survey?'; // For chrome } } window.onbeforeunload = goodbye; $(document).on('click', '.button, .changelang, [name="move"]', function(event){ //added .changelang here, please add other classes if you know which should be allowed to navigate $('body', top.document).addClass('submitted'); });
//FEATURES: (2015-03-27) Now with fix for iframes (e.g. file uploader) and the template editor function goodbye(e) { if(!$('body', top.document).hasClass('submitted') && !$('#completed').length && !$('.templateeditor', top.document).length) { //check if a button was used to navigate OR the survey is completed OR the template is displayed in the template editor
<a href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" title={{ aSurveyInfo.aCompleted.aPrintAnswers.sTitle }} class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>
<a target="_blank" href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" title={{ aSurveyInfo.aCompleted.aPrintAnswers.sTitle }} class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>