- Posts: 18
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); var thisTable = $('table.subquestion-list:eq(0)', thisQuestion) $($('.answer-text .filter', thisTable).get().reverse()).each(function(i) { var thisIndex = $(this).closest('th').index(); var filter = $.trim($(this).text()); if($('span[id^="LEMtailor"]', this).length > 0) { filter = $.trim($('span[id^="LEMtailor"]', this).text()) } if(filter == 'Y') { hideColumn(thisIndex) } }); function hideColumn(index) { $('col:nth-child('+(index+1)+'), thead .answer-text:nth-child('+(index+1)+'), tr.answers-list .answer-item:nth-child('+(index+1)+')', thisTable).hide(); $('tr.answers-list .answer-item:nth-child('+(index+1)+') :radio:checked', thisTable).each(function(i) { $(this).prop('checked', false); checkconditions('', $(this).attr('name'), $(this).attr('type')); }); } }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); var thisTable = $('table.subquestion-list:eq(0)', thisQuestion) $($('.ls-heading .filter', thisTable).get().reverse()).each(function(i) { var lineRead = $($('.ls-heading .filter', thisTable).get().reverse()); var thisIndex = $(this).closest('th').index(); var filter = $.trim($(this).text()); if($('span[id^="LEMtailor"]', this).length > 0) { filter = $.trim($('span[id^="LEMtailor"]', this).text()) } if(filter == 'Y') { hideColumn(thisIndex) } }); function hideColumn(index) { $('td.answer-item:nth-child('+(index+1)+')', thisTable).hide(); $('th.answertext:nth-child('+(index+1)+')', thisTable).hide(); $('tr.ls-heading th:nth-child('+(index+1)+')', thisTable).hide(); $('col:nth-child('+(index+1)+')', thisTable).hide(); } }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); var thisTable = $('table.subquestion-list:eq(0)', thisQuestion) $($('.answer-text .filter', thisTable).get().reverse()).each(function(i) { var thisIndex = $(this).closest('.answer-text').index(); var filter = $.trim($(this).text()); if($('span[id^="LEMtailor"]', this).length > 0) { filter = $.trim($('span[id^="LEMtailor"]', this).text()) } if(filter == 'Y') { hideColumn(thisIndex) } }); function hideColumn(index) { $('col:nth-child('+(index+1)+'), .ls-heading .answer-text:nth-child('+(index+1)+'), tr.answers-list .answer-item:nth-child('+(index+1)+')', thisTable).hide(); $('tr.answers-list .answer-item:nth-child('+(index+1)+') :radio:checked', thisTable).each(function(i) { $(this).prop('checked', false); checkconditions('', $(this).attr('name'), $(this).attr('type')); }); } }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question'+{QID}+''); // Add some column-specific classes $('table.subquestions-list tr', thisQuestion).each(function(i){ $('> *', this).each(function(i){ $(this).addClass('column-'+(i+1)); }); }); // Hide all column-1 elements $('.column-1', thisQuestion).hide(); $('table.subquestions-list col', thisQuestion).css('width', 'auto'); }); </script>
Please Log in to join the conversation.