I have been testing this sub-question validation for a while now and brought it to almost perfectly working state. There is one issue left, enough important to explain it this post.
The validation is created with a help of regexp ^(0?[1-9]|1[0-2])\/([0-2]\d\d\d)$, which in sub-question validation field looks like this:
Code:
is_empty(this) or regexMatch('/^(0?[1-9]|1[0-2])\/([0-2]\d\d\d)$/',this)
is_empty(this) is used to validate all the fields non relevant to q1 - to pass the rest of the fields not linked with entered data from q1
Until here and beyond everything works well. In q2 we enter start-date and end-date. To limit the maximum amount of dates entered there is a minimum answers limit:
Code:
count(that.q1.sq_1)*2
This comes very handy for enabling the input of dates only for the non-empty fields from q1.
As there are all the lines shown in q2
(see the image above), even those non related to the data from q1, using of Array filtering is necessary to:
1. create a proper design of the question and
2. (more important) to not let the user achieving the minimum answers limit by filling the dates in non pertinent fields (lines non related to data from q1)
But at this point, when array filtering comes forth the logic for sq-validation fails. I have no clue how to make this work. I've attached the survey example if someone can take a look into this
(to raise the issue array filtering has to be set in q2). Thanks for the propositions!
Of course, if a array-multi-date type of question existed, that would be the nicest solution. Maybe another idea for future LS development.