- Posts: 1
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
$(document).on('ready pjax:scriptcomplete',function(){ // When the window is blurred (i.e., loses focus) $(window).blur(function(){ if (tabSwitches !== undefined) { // We check if we have defined TB before var tabSwitches = ""; // If not, we define it } tabSwitches += ("{SGQ}"); // Then we add the question ID to the string tabSwitches += "&"; // And add & as a separator }); });
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { // Hide this answer field document.getElementById("answer{SGQ}").style.display='none'; // Save tabSwitches $('input#answer{SGQ}').text(tabSwitches); // Troubleshoot alert("SGQ is: {SGQ} and tabSwitches is: " + tabSwitches); }); </script>