How to keep moving through survey with custom validation | XM Community
Question

How to keep moving through survey with custom validation

  • 26 June 2019
  • 1 reply
  • 4 views

Hello, I would love some help as I've been searching and Googling for answers but can't find anything.

Survey questions:
Q#4: What population does your treatment program target?
* Options: a) female, b) male, c) high-risk offenders, d) parents

Q#5: What supervision level do you target?
* Options: a) High, b) Medium, c) Low

The broader goal is to have a pop-up message that asks the respondent if they're sure about their answers for #4 and #5 if they contradict each other (i.e., if someone selects "c" for #4 and "c" for #5, and to have them be able to go back and make sure they answered it correctly. If they are sure that their answer for #4 is "c" and #5 is "c", we want to let them continue moving on with the survey.

I couldn't figure out how to create this pop-up message so currently, I added the custom validation option so that if they select "c" for #4 and "c" for #5, the error message that pops up will say something like "please make sure your answers for Q#4 and #5 are correct", but it won't let the respondents move forward with the survey unless they go back and select "high" for #5. I asked the Support team but they said I would need to add some JavaScript code for that to happen (which I am unfamiliar with and have been looking everywhere and tried different codes to do this). Could anyone suggest other options or know what JavaScript code I could add to make this happen?

Thank you so much!

1 reply

Userlevel 7
Badge +27
Actually, you don't need JS for this. Create a Text Description question as a 3rd question on the page. Add in-page display logic to it so it displays when the answers to the first two questions seem incompatible.

Leave a Reply