Welcome to the LimeSurvey Community Forum

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

Question validation equation error

  • waitz
  • waitz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 9 months ago - 5 years 9 months ago #169584 by waitz
Question validation equation error was created by waitz
I have a custom validation of a subquestion in a Mulitiple Short Text question. In the Question validation equation field I have entered:
Code:
(is_empty(PHONE_TEL01.NAOK) OR regexMatch('/^\+(?: ?\d)+$/',PHONE_TEL01.NAOK))

This gives a warning and a red box around the question even before the user has started to enter anything in the field.
How can I wait to give a warning of the field being filled incorrectly until the user presses Next to continue the survey?

Version 2.73.1+171220
Last edit: 5 years 9 months ago by waitz.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #169636 by tpartner
Replied by tpartner on topic Question validation equation error
What is the regex supposed to restrict to? Can you attach a sample survey containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • waitz
  • waitz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 9 months ago #169646 by waitz
Replied by waitz on topic Question validation equation error
The question has 5 subquestions, and the user has to fill in at least one of the subquestions, and this subquestion has to fullfill the requirement of being an international phone number.

File Attachment:

File Name: limesurvey....lsq.txt
File Size:8 KB

Version 2.73.1+171220
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #169711 by tpartner
Replied by tpartner on topic Question validation equation error
Your sample question seems to work as expected for me. Initially, there is no red border but the warning text is red as it should be because the question is unanswered.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose