I had another idea to use two types of calendars, which is using an array text question and adding a script to the question to make the array text dropdown list and then fill in the cells, but I have one problem with the script if I add an element to Subquestion 1. then all the Subquestions that in the same column will be filled with the same elements
here is the question sample
[MOD: Screenshot deleted as it was causing "code salad"]
and here is the script and the source that i copied the script from
<p>Q1e...</p>
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var thisQuestion = $('#question{QID}');
// Insert selects
$('.answer-item.answer_cell_X001', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">select...</option>\
<option value="1">000</option>\
<option value="2">000</option>\
<option value="3">000</option>\
<option value="4">000</option>\
<option value="5">0e0</option>\
<option value="6">0e0</option>\
<option value="7">000</option>\
<option value="8">0w</option>\
<option value="9">000</option>\
</select>');
$('.answer-item.answer_cell_X002', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">select...</option>\
<option value="1">1</option>\
<option value="3">3</option>\
<option value="5">5</option>\
</select>');
$('.answer-item.answer_cell_X003', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">select...</option>\
<option value="1">1</option>\
<option value="5">5</option>\
<option value="7">7</option>\
<option value="9">9</option>\
</select>');
$('.answer-item.answer_cell_X004', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">select...</option>\
<option value="1">1</option>\
<option value="5">5</option>\
<option value="6">6</option>\
<option value="7">7</option>\
<option value="8">8</option>\
</select>');
// Listeners
$('.inserted-select', thisQuestion).on('change', function(i) {
if($(this).val() != '') {
$(this).closest('.answer-item').find('input:text').val($.trim($('option:selected', this).text())).trigger('change');
}
else {
$(this).closest('.answer-item').find('input:text').val('').trigger('change');
}
});
// Returning to page
$('.with-select input:text', thisQuestion).each(function(i) {
var thisCell = $(this).closest('.answer-item');
var inputText = $.trim($(this).val());
var selectval = $('select.inserted-select option', thisCell).filter(function () { return $(this).html() == inputText; }).val();
$('select.inserted-select', thisCell).val(selectval);
});
// Clean-up styles
$('select.inserted-select', thisQuestion).css({
'max-width': '100%'
});
$('.with-select input:text', thisQuestion).css({
'position': 'absolute',
'left': '-9999em'
});
});
</script>
source:
forums.limesurvey.org/forum/can-i-do-thi...own-in-a-array-texts
can i make each cell independent in case of adding new elements ?