- Posts: 123
- Thank you received: 9
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var thisQuestion = $('#question{QID}'); // Remove some text inputs $('.checkbox-text-item:eq(0) .comment-container', thisQuestion).remove(); $('input:checkbox:eq(0)', thisQuestion).remove(); <-- This line doesn't work, what do I need? $('.checkbox-text-item:eq(1) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(2) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(3) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(4) .comment-container', thisQuestion).remove();
<script charset="utf-8" type="text/javascript"> $(document).ready(function() { $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); $( '#question{QID} .question-item:eq(4)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); $( '#question{QID} .question-item:eq(7)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('.comment-container').remove(); $( '#question{QID} .question-item:eq(4)').addClass('hide-pseudo-elements').find('.comment-container').remove(); $( '#question{QID} .question-item:eq(7)').addClass('hide-pseudo-elements').find('.comment-container').remove(); }); </script>
<style type="text/css">.hide-pseudo-elements label::before, .hide-pseudo-elements label::after { display: none; } .hide-pseudo-elements .label-text { margin-left: -20px; } </style>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var thisQuestion = $('#question{QID}'); // Remove a checkbox $('input:checkbox:eq(0)', thisQuestion).remove(); $('td.checkbox:eq(0)', thisQuestion).removeClass('checkbox'); // Remove some text inputs $('.checkbox-text-item:eq(0) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(1) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(2) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(3) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(4) .comment-container', thisQuestion).remove(); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var thisQuestion = $('#question{QID}'); // Remove some text inputs $('.checkbox-text-item:eq(0) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(1) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(2) .comment-container', thisQuestion).remove(); $('.checkbox-text-item:eq(3) .comment-container', thisQuestion).remove(); // Insert sub-headings $('tr.answer-item:eq(0)', thisQuestion).before('<tr class="inserted-sub-heading"><th colspan=2>Sub-heading 1</th></tr>'); $('tr.answer-item:eq(3)', thisQuestion).before('<tr class="inserted-sub-heading"><th colspan=2>Sub-heading 2</th></tr>'); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var thisQuestion = $('#question{QID}'); // Remove some text inputs $('.checkbox-text-item:eq(0) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(1) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(2) .comment-item', thisQuestion).remove(); $('.checkbox-text-item:eq(3) .comment-item', thisQuestion).remove(); // Insert sub-headings $('.checkbox-text-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading">Sub-heading 1</li>'); $('.checkbox-text-item:eq(3)', thisQuestion).before('<li class="inserted-sub-heading">Sub-heading 2</li>'); }); </script>