- Posts: 115
- Thank you received: 4
Ask the community, share ideas, and connect with other LimeSurvey users!
// Page timeout action function pageTimeout() { //window.location = redirectURL; // Find the group index var groupIndex = $('div[id^="group-"]').attr('id').split('group-')[1]; if(groupIndex[0] >= 0) { $('#movesubmitbtn').click(); } else { window.location = redirectURL; } }
$('#movesubmitbtn').click();
$('#movesubmitbtn').click();
if(groupIndex[0] >= 0) {
if(groupIndex >= 0) {
$(document).ready(function(){ var txtAlertMessage = 'Anyone there? Do you want to continue?'; var txtCloseButton = 'Continue'; var redirectURL = location.pathname.split('index.php')[0]; var timeToAlert = 2; // In seconds var timeToRedirect = 2; // In seconds // Page timeout action function pageTimeout() { // Find the group index - var groupIndex = $('div[id^="group-"]').attr('id').split('group-')[1]; if(groupIndex >= 0) { $('#movesubmitbtn').click(); } else { window.location = redirectURL; } } // Alert Timer var alertTimer; function startAlertTimer() { alertTimer = setTimeout(function() { $('.custom-dialog-1').dialog('open'); },timeToAlert*1000); } function stopAlertTimer() { clearTimeout(alertTimer); } function restartAlertTimer() { clearTimeout(alertTimer); startAlertTimer(); } startAlertTimer(); // Redirect Timer var redirectTimer; function startRedirectTimer() { redirectTimer = setTimeout(function() { pageTimeout(); },timeToRedirect*1000); } function stopRedirectTimer() { clearTimeout(redirectTimer); } function restartRedirectTimer() { clearTimeout(redirectTimer); startRedirectTimer(); } // Insert the alert dialog var timeoutDialog = '<div class="custom-dialog-1"> <div class="text">'+txtAlertMessage+'</div> <div class="buttons"> <button class="close" type="button" value="close">'+txtCloseButton+'</button> </div> </div>'; $(timeoutDialog).dialog({ autoOpen: false, open: function( event, ui ) { startRedirectTimer(); //IE 10 z-index hack $('.ui-widget-overlay').css('z-index', Number($('.ui-widget-overlay').css('z-index')) - 2); }, close: function( event, ui ) { stopRedirectTimer(); restartAlertTimer(); }, width: 400, modal: true, resizable: false, draggable: true, closeOnEscape: true, dialogClass: 'timeout-dialog' }); $('.timeout-dialog button').click(function() { $('.custom-dialog-1').dialog('close'); }); // Listener for activity $('#limesurvey').on('click keyup paste change' ,function(event){ restartAlertTimer(); }); });
$(document).ready(function(){ var txtAlertMessage = 'Anyone there? Do you want to continue?'; var txtCloseButton = 'Continue'; var redirectURL = location.pathname.split('index.php')[0]; var timeToAlert = 2; // In seconds var timeToRedirect = 2; // In seconds // Page timeout action function pageTimeout() { // Find the group index - var groupIndex = $('div[id^="group-"]').attr('id').split('group-')[1]; if(groupIndex >= 0) { $('#movesubmitbtn').click(); } else { window.location = redirectURL; } } // Alert Timer var alertTimer; function startAlertTimer() { alertTimer = setTimeout(function() { $('.custom-dialog-1').dialog('open'); },timeToAlert*1000); } function stopAlertTimer() { clearTimeout(alertTimer); } function restartAlertTimer() { clearTimeout(alertTimer); startAlertTimer(); } startAlertTimer(); // Redirect Timer var redirectTimer; function startRedirectTimer() { redirectTimer = setTimeout(function() { pageTimeout(); },timeToRedirect*1000); } function stopRedirectTimer() { clearTimeout(redirectTimer); } function restartRedirectTimer() { clearTimeout(redirectTimer); startRedirectTimer(); } // Insert the alert dialog var timeoutDialog = '<div class="custom-dialog-1">\ <div class="text">'+txtAlertMessage+'</div>\ <div class="buttons">\ <button class="close" type="button" value="close">'+txtCloseButton+'</button>\ </div>\ </div>'; $(timeoutDialog).dialog({ autoOpen: false, open: function( event, ui ) { startRedirectTimer(); //IE 10 z-index hack $('.ui-widget-overlay').css('z-index', Number($('.ui-widget-overlay').css('z-index')) - 2); }, close: function( event, ui ) { stopRedirectTimer(); restartAlertTimer(); }, width: 400, modal: true, resizable: false, draggable: true, closeOnEscape: true, dialogClass: 'timeout-dialog' }); $('.timeout-dialog button').click(function() { $('.custom-dialog-1').dialog('close'); }); // Listener for activity $('#limesurvey').on('click keyup paste change' ,function(event){ restartAlertTimer(); }); });
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $( '#question{QID} input.radio' ).click(function() { document.limesurvey.submit(); }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input.radio').click(function() { checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type')) $('#movenextbtn, #movesubmitbtn').trigger('click'); }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input.radio').click(function() { checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type')) $('#movenextbtn, #movesubmitbtn').trigger('click'); }); }); </script>
One or more mandatory questions have not been answered . Please answer this first to proceed !