Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Validating Multiple numerical input

  • harvas
  • harvas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 month ago #116386 by harvas
Validating Multiple numerical input was created by harvas
Hello all,

Unfortunately, I am posting this because I have not been able to find a similar response in the forum. I have a Multiple numerical input question type with four different subquestions: ll1cor1, ll1sim1, ll1int1 and ll1per1. I want two (2) out of the four sub-questions to be limited to a specific range of values (i.e. from 0 to 16 and -1000 to -5000), while the other two should be limitless. If I use the validation field with the following expression: /^([0-9]|1[0-6]|-1000|-2000|-3000|-4000|-5000)$/, this is applied to all the sub-questions. I have created the following validation expression: (is_empty(ll1cor1) or regexMatch('/^([0-9]|1[0-6]|-1000|-2000|-3000|-4000|-5000)$/', ll1cor1)) and (is_empty(ll1sim1) or regexMatch('/^([0-9]|1[0-6]|-1000|-2000|-3000|-4000|-5000)$/', ll1sim1)) which I aimed to us within the "Question validation equation" field. This has not worked. Neither using it within the "Sub-question validation equation" field.

I had difficulties understanding through the manual how these fields are used and utilised. Could someone assist me in the syntax and explain what am I doing wrong?

Thanks in advance.

BR,

Charis
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago - 9 years 1 month ago #116468 by tpartner
Replied by tpartner on topic Validating Multiple numerical input
You cannot have different validation for sub-questions within a question. You will need to use separate questions.

Whole question validation equation - this equation encompasses the entire question and must be met to proceed. For example, the sum of all inputs must be greater than n.

Sub-question validation equation - this equation applies to every sub-question must be met by every sub-question to proceed. For example, every sub-question must be greater than n.


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 1 month ago by tpartner.
The following user(s) said Thank You: harvas
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose