Welcome to the LimeSurvey Community Forum

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

only letters (A-Z) in respons

More
4 years 1 month ago #218284 by amsta1
I would like only (capital) letters (A to Z) possible in an answer (so the respondents are not allowed to give numbers as an answer). The questiontype I selected is: short free text (type S).

The LimeSurvey version I use is 3.17.0+190402

I hope someone knows how to tackle this?

thanks!
The topic has been locked.
More
4 years 1 month ago - 4 years 1 month ago #218286 by tpartner
Insert a question validation equation something like this:
 
 
Code:
is_empty(this) OR regexMatch("/^[A-Z]+$/", this)

- www.limesurvey.org/manual/ExpressionScri...mplemented_functions

Sample survey attached: 

File Attachment:

File Name: limesurvey...1446.lss
File Size:17.7 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 1 month ago by tpartner.
The topic has been locked.
More
4 years 1 month ago #218290 by amsta1
thank you, but this does not work unfortunately. I am still able to give a number for an answer...
The topic has been locked.
More
4 years 1 month ago #218291 by tpartner
Really? In my sample survey, you can advance past the first screen with a number in Q1?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
4 years 1 month ago #218300 by amsta1
thank you, I think I have put the code in the wrong field. I now used /^([^0-9]*)$/ in the validation field (at general options) to prevent respondents to give a number as an anwer. Now it works!
The topic has been locked.
More
4 years 1 month ago #218313 by tpartner
I don't know why I bother with sample surveys. In the survey I provided, you would have seen it in the "Question validation equation" field.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
4 years 1 month ago #218318 by DenisChenu

I don't know why I bother with sample surveys. In the survey I provided, you would have seen it in the "Question validation equation" field.
 
:applause:

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