Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.17
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
I combine the two workarounds to
- add drop-downs in an array(text)
- add the dynamic display of rows with "varLengthArray"
Like this:
Now if I remove the last row
and add a row again, only the text value is removed, but the value of the drop-down is still there.
I think there has to be added something to this part of the script, but because of my very limited knowledge of javascript...
Code:
function removeRow(qID) {
var arrayRow = '#question' + qID + ' table.ls-answers tr.subquestion-list';
var rowCount = $( arrayRow ).size() - 1;
$( arrayRow + '[name="visible"]:last input[type="text"]' ).val('');
$( arrayRow + '[name="visible"]:last' ).attr('name', 'hidden').hide();
$( 'div#addButton'+qID ).show();
if ( $( arrayRow + ':eq(1)' ).attr('name') == 'hidden' ) {
$( 'div#removeButton'+qID ).hide();
}
}
Here the lss export of this example.
I hope somebody can help.
Thank you in advance
Joffm