I have two columns and several rows in a question of type Array(Number), each answer drop-down list contains 60 options, which are numbers from 1 to 60. I would like to pre-fill all the drop-down lists so when the page is loaded they already have zeros as chosen options.
I'm trying to do the same thing (pre-filling array (numbers)), but based on some token attributes. For instance, if my token attributes 3 =1, the number of the array should be 1. I know how to do this fow single answer questions, dropdown or multiple answers choice, but it doesn't work for this array (numbers), as numbers are not answers options I defined (but automatically generated according to the range I chose). Would you have a solution for this?
Thanks!! Indeed it works! However, I used the techniques you described in this topic:
www.limesurvey.org/forum/can-i-do-this-w...my-solution&start=20
In order to have two columns with related question side by side.
Then, when using the code you just provided above, it fills all the possible answers (see caption attached: for "goals", I want to let the choice to add from 1 to 6 goals, all being different). Then, ideally, when prefilling it would only fill one row.
There is still a small issue as this code then prefill all the columns from row 1. My second column is an array flexi, with a dropdown option and several answers options (different from the one in the first column). I'm trying to add a prefilled answer for the second column then, based on your code, but it does not work. Do you understand what I missed? I tried to add this at the end of the previous code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var rowNumber = 1;
var nextArrayFlexi = $(thisQuestion).nextAll('.array-flexible-row:eq(0)');
$('tbody[id^="javatbd"]:eq('+(rowNumber-1)+') select', nextArrayFlexi).each(function(i) {