Custom validation based on answers to previous questions | XM Community
Solved

Custom validation based on answers to previous questions

  • 19 June 2019
  • 1 reply
  • 27 views

Hi there!

I'm trying to ensure that respondents who answer 'yes' in either of the two previous questions, must then enter their email address in the following question (see attached for screenshots).

At the moment the logic isn't working correctly. I am prompted to enter an email when I select 'yes' in one of the two questions, BUT I'm also getting an error message when I enter an email address.

!
icon

Best answer by NiC 19 June 2019, 22:24

View original

1 reply

Userlevel 7
Badge +27
Hi @Beyond ,

Your current validation conditions are incorrect it should be somehat like the conditons shown below:
!
Note : Here my Q1 is like your Q65 , Q3 is like your Q66 and Q2 is like your Q68.
And here is the regex i have used to test if entered text is email :
^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$

Leave a Reply