Welcome to the LimeSurvey Community Forum

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

Input validation - restrict to caps

  • sarathka
  • sarathka's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #205845 by sarathka
Input validation - restrict to caps was created by sarathka
Hi All,


I have created a survey and I want participants to enter answers in capital letters only. I found input validation option in question editor.




However I can't seem to figure out the correct regex to achieve this. I tried many expressions like :

/([^A-Z]*)$/
regexMatch("/[A-Z]*$/")
regexMatch('/([A-Z]{2,30})/')
regex(., ‘^[A-Z]{2,30}$’)


Can someone please tell me/show me the correct format to use? I am using Version 4.3.2+200629.


Thanks & Regards,
Sarath
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #205862 by DenisChenu
Replied by DenisChenu on topic Input validation - restrict to caps
manual.limesurvey.org/Question_type_-_Sh...28preg_validation.29

You must put directlly the regexp : /([^A-Z]*)$/ must work i think.

This option are an old system before we have manual.limesurvey.org/Question_type_-_Sh...28em_validation_q.29

Where you can use regexpMatch Expression function like this regexMatch("/[A-Z]*$/", self.NAOK)

Or strtoupper(self.NAOK) == self.NAOK

See manual.limesurvey.org/ExpressionScript_E..._-_Quick_start_guide

PS : if you can export a sample lss with /([^A-Z]*)$/ as validation, i really think it must work.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose