Hi, Tammo,
it tokk a long time to find a suitable solution without validating each single cell.
My first idea was that it is sufficient that the minimum of a column is not less than the least allowed value and the maximum of a column not greater.
But I got in trouble to calculate the minimum because of the not displayed rows.
Now here is my solution:
To select the year insert a dropdown where the years are displayed dynamically
Here this part of the script
Code:
...
var currentTime = new Date();
// returns the year (four digits)
var year = currentTime.getFullYear();
// Insert selects
$('.answer-item.answer_cell_X002', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
<option value="">...</option>\
<option value="'+year+'">'+year+'</option>\
<option value="'+(year-1)+'">'+(year-1)+'</option>\
<option value="'+(year-2)+'">'+(year-2)+'</option>\
<option value="'+(year-3)+'">'+(year-3)+'</option>\
<option value="'+(year-4)+'">'+(year-4)+'</option>\
<option value="'+(year-5)+'">'+(year-5)+'</option>\
</select>');
...
And to validate the length of vacation I use an inputmask
[url]
robinherbots.github.io/Inputmask/#/documentation
[/url]
with a regular expression as mask
Code:
$('#question{QID} .answer_cell_X003 input[type="text"]').inputmask({
'regex': '[1-9][0-9]?',
'placeholder': '_',
'removeMaskOnSubmit': false,
'rightAlign': true,
});
The question is mandatory. So all fields have to be filled.
As a second proposal here the same, but with "dynamic" rows.
Because rows are hidden by javascript, you have to validate that a row is filled.
Just by counting the entries. Has to be a multiple of 3.
count(self.NAOK)/3==floor(count(self.NAOK)/3)
Here the lss
Joffm