Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

adding suffix to array in 2.06 not working

More
7 years 10 months ago #136948 by n2xek
hi,

I'm hoping someone can help with the workaround for adding suffix to arrays. This workaround was fine in 1.86, but doesn't seeme to work with 2.06. I think it as something to do with the label class="hide read" in 2.06.

Here is the workaround that was working... and is not anymore.

script type="text/javascript" charset="utf-8">

$(document).ready(function() {

// Call the function with the question ID followed by a comma-separated list of suffixes
addSuffix(12345, 'in €', 'in %', 'in %', 'in %');

function addSuffix() {
var qID = $(arguments)[0];

// Assign some column-specific classes
$('#question'+qID+' table.question tbody tr').each(function(i){
$('td', this).each(function(i){
$(this).addClass('answerCol-'+(i+1)+'');
});
});

// Some styling
$('#question'+qID+' table.question tbody input[type="text"]').css({
'width': '50%'
});

// Insert the suffixes
$(arguments).each(function(i, val){
if(i > 0) {
$('#question'+qID+' td.answerCol-'+i+' label').append(val);
}
});
}
});
</script>
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose