Custom validation with JavaScript variable | XM Community
Skip to main content
Question

Custom validation with JavaScript variable

  • February 21, 2024
  • 3 replies
  • 86 views

Forum|alt.badge.img+1

Hi all,

I have 2 questions with text entry in the same page. I need to use custom validation for question 2 depending on the text entry in question 1. Could you help me to do that.

 

Best

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • February 21, 2024

Use the value from question 1 in the custom validation condition for question 2.


Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 306 replies
  • February 21, 2024

Hi @Nahed , Below is the visual representation of what TomG is saying.

Use custom validation

 

I have kept the validation as ‘Q2 value should be equal to that of Q1’ by using pipe text value of the Q1 entered choice. You can modify it according to your need i.e., less than, greater than, etc. 

Forum|alt.badge.img+1
  • Author
  • 5 replies
  • February 21, 2024

Thank you so much for your help.