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
4 years 7 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 & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 years 7 months ago #205862 by DenisChenu
Replied by DenisChenu on topic Input validation - restrict to caps
www.limesurvey.org/manual/Question_type_...28preg_validation.29

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

This option are an old system before we have www.limesurvey.org/manual/Question_type_...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 www.limesurvey.org/manual/ExpressionScri..._-_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 support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose