Hi everybody,
first of all: I know this was asked before. I just can not make this code work (taken from
www.limesurvey.org/de/forum/can-i-do-thi...pty-rows-of-a-matrix). Did something change there in the last updates? Unfortunately I'm not really fit in JavaScript, so please excuse if this is a stupid question. I have my questiongroup attached.
code in the description of the questiongroup:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Hide all rows without a row label
$('table.question tbody').each(function(i, el){
var rowLabel = $('th:first', el).text().replace(/[\s\n\t]/g,'');
if(rowLabel == '' || rowLabel == 'Newansweroption') {
$(el).hide();
}
});
// Fix up row background colours
$('table.question tbody:visible tr').each(function(i, el){
$(el).removeClass('array1, array2');
if(i % 2 == 0) {
$(el).addClass('array2');
}
else {
$(el).addClass('array1');
}
});
});
</script>
Second question is te corresponding matrix, rows are filled correctly by the {if} statement, but empty rows are shown nevertheless.
Thanks a lot for any input!
Steffen