Survey Solutions

Support portal and knowledge base

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Validation of answers in a list question

Ana Moltedo May 14, 2018 06:05PM EDT

I have a list question with a maximum of 3 to list telephone numbers.

Three types of telephone numbers are valid:
1) If the first digit is 0 and the second digit is different from 0 the length should be 9
2) if the first digit is different from 0 and different from + the length should be 8
3) otherwise it can be any number

I would like to popup an error message when one of the telephone numbers entered is incorrect. How can I do this validation?

Many thanks

Up 0 rated Down
Sergiy Radyakin May 15, 2018 12:18PM EDT Survey Solutions Agent

Ana, you can use string functions to formulate your rules.

For example, your rule #1 is something like:
!(phone.StartsWith(“0”) && !phone.StartsWith(“00”) && phone.Length!=9)

your rule #2 is:
!(!phone.StartsWith(“0”) && !phone.StartsWith(“+”) && phone.Length!=8)

and clearly rule 3 you don’t need as it is the default.

Best, Sergiy Radyakin

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
support@mysurvey.solutions
http://assets2.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete