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?
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