- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
{self.gseq + 1}
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify some stuff var qHiddenID = {QID}; // The hidden question ID var qHidden = $('#question'+qHiddenID); // The hidden question var q1 = $('div.list-radio:eq(0)'); // First radio question on the page var q1ID = $(q1).attr('id').split('question')[1]; // The first radio question ID var gID = $('input.text', qHidden).attr('id').split('X')[1]; // The group ID // Hide this question $(qHidden).hide(); // Build an array of the Q1 answers var answersArr = new Array(); $('input.radio', q1).each(function(i){ var answerID = $(this).attr('id').split('X'+gID+'X'+q1ID)[1]; answersArr.push(answerID); }); // Load the array into the hidden question $('input.text', qHidden).val(answersArr); }); </script>
The 'this' variable is used exclusively within the "Whole question validation equation" and "Sub-question validation equation" advanced question options. It expands to the variable names of each of the cells within those questions.