Welcome to the LimeSurvey Community Forum

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

Using validation equation to set minimum number of answers

  • irismpi
  • irismpi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #202024 by irismpi
I have an Array (text) with 5 answer fields and I want people to fill in at least 3 words.
If don't want to use the function in “logic” to set the Minimum number of answers to 3 because I need to change the text that is shown (the warning note with the exclamation mark)

So I tried to use the validation equation, but I still struggle a bit with getting this right. Can someone help me in writing the correct syntax?


Question-type: Array (text)

My subquestions look like this:
Y-axis: SQ00A
X-axis: SQ001
SQ002
SQ003
SQ004
SQ005

(see also attached Picture 1)

My validation equation looks like this:
(!(is_empty(S01_SQ00A_SQ001) and is_empty(S01_SQ00A_SQ002) and is_empty(S01_SQ00A_SQ003)))

And I added a validation tip
"enter at least 3 and at most 5 words"

(see also attached Picture 2)

People should give at least 3 answers (and a maximum of 5 answers) before they can continue. They should be allowed to click on "next" when they have given a minimum of 3 answers.
However, If I click on "preview survey" I now need to fill in all 5 text-boxes before I can click on "next".
How do I change this?

(see also attached Picture 3)
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #202028 by DenisChenu

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