How can I have 2 specific validation requirements for one question? | XM Community
Skip to main content
Solved

How can I have 2 specific validation requirements for one question?

  • October 11, 2023
  • 3 replies
  • 134 views

Forum|alt.badge.img+14

If I want respondents to only be able to answer a text entry question by typing exactly 9 digits AND these 9 characters can only be numbers, how can I do that? 

Right now, I have it set to validate with a character range of min of 9 and max of 9. The problem is that this still allows people to type in letters or other symbols, rather than only numbers. 

Best answer by TomG

You can use matches regex ^[0-9]{9}$

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • October 11, 2023

You can use matches regex ^[0-9]{9}$


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • October 11, 2023

@ash123 Set validation to match regex ^\d{9}$

 


Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • October 11, 2023

Perfect, thank you!!