Hi,
1. (is_empty(
SQ001.NAOK) or regexMatch('/^[1-9][0-9]{0,4}$/',
SQ001.NAOK))
a. This is not a correct QCODE.
b. You do not test the comment box, but the checkbox
Please read the manual
[url]
www.limesurvey.org/manual/ExpressionScri...code_variable_naming
[/url]
And it's always a good advice to activate the survey and have a look at the response table. Here you see how you access all variables.
2. (is_empty(SQ001.NAOK) or regexMatch('/^
[1-9][0-9]{0,4}$/', SQ001.NAOK))
a, The regexMatch will allow numbers up to 99999.
Use a regex tester like [url]
regex101.com/
[/url] to generate it.
b. If you use a correct regular expression you do not need to test for "is_empty"
3. Your validation tip is not correct.
You test each subquestion separately.
Either you should test all in one equation to show only one error message like "Only numbers between 1 and 100 are allowed"
{if(!regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ001comment) OR !regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ002comment) OR !regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ003comment) OR ...,'Please, only numbers...','')}
Or you test the subquestions one by one, in a nested IF function
{if(!regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ001comment),'Please enter only numbers in '+Q01_SQ001.question, if( !regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ002comment),'Please enter only numbers in '+Q01_SQ002.question,if(!regexMatch('/^([1-9][0-9]?[0]?)?$/',Q01_SQ003comment), 'Please enter only numbers in '+Q01_SQ003.question,...,''))))))))))}
Joffm