Welcome to the LimeSurvey Community Forum

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

Problem with question validation equation

  • ch123
  • ch123's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 1 month ago - 4 years 1 month ago #194269 by ch123
Hey,

I'm trying to use question validation equation in order to "force" participants to write at least 50 characters in an open text field.
It's working when writing the sentence in one line. But if you press enter and want to write in the next line, there is an error (even if there are 50 characters in the first line).

This is my code so far:
Code:
regexMatch('/^.{50,}$/', XXX)
Probably have to add some expression for the lines? But I don't get it how to do it...
Thanks for any help :)
Last edit: 4 years 1 month ago by ch123.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago - 4 years 1 month ago #194283 by Joffm
Replied by Joffm on topic Problem with question validation equation
Add a line terminator "\n"
regexMatch('/^(.|\n){50,}$/', XXX)

.{50,} matches any character (except for line terminators) from regex101.com/

Joffm

P.S. I did not test it in LS, only on the Regex page.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 1 month ago by Joffm.
The following user(s) said Thank You: ch123
The topic has been locked.
  • ch123
  • ch123's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 1 month ago #194290 by ch123
Replied by ch123 on topic Problem with question validation equation
Seems to be working fine - thank you, really nice!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose