Welcome to the LimeSurvey Community Forum

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

How do I set a list of non consecutive numbers in a numeric type question?

  • helviobrito
  • helviobrito's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 3 weeks ago #133677 by helviobrito
Please,

I have a numeric question that must accept only the numbers 5, 6, 7 and 99 as answers. How can I set this? I looked for a tip in the manual, but didn't find.

Thanks.
Helvio Brito
The topic has been locked.
  • helviobrito
  • helviobrito's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 3 weeks ago #133679 by helviobrito
I found it in the manual. Sorry.
Here is the answer, to anyone with the same doubt:
Just insert in the Validation field:
/^([5-7]|[9][9])$/

This means that the units 5 to 7 and the number 99, made of the ten [9] plus the unit [9] are accepted.

manual.limesurvey.org/Using_regular_expr...ns#Number_validation
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose