- Posts: 44
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Problem with question validation equation
- ch123
- Topic Author
- Offline
- Senior Member
Less
More
4 years 1 month ago - 4 years 1 month ago #194269
by ch123
Problem with question validation equation was created 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:
Probably have to add some expression for the lines? But I don't get it how to do it...
Thanks for any help
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)
Thanks for any help
Last edit: 4 years 1 month ago by ch123.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
4 years 1 month ago - 4 years 1 month ago #194283
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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.
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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 3
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.