Set numeric text entry validation in a multiple choice single answer question | XM Community
Skip to main content
Solved

Set numeric text entry validation in a multiple choice single answer question

  • October 3, 2019
  • 3 replies
  • 162 views

Forum|alt.badge.img+3
I have a question asking about years of nursing practice. It's a single select question and only the first option allows a numeric entry. I have set force response if first option is selected. That works. I also wanted to set validation for the numeric entry so that it's above 0 and below 30. However, once I set the validation using custom validation, the numeric entry is required no matter which option is selected (when I select not sure, it still popped up a error message asking me to fill the box with a number between 0 and 30. How do I set a validation which applies only one the first options is selected? !

Best answer by Akdashboard

You need to add OR statements to your validation logic. Something like IF "Etner years of practice, text entry is greater than 0 or less than 30 OR Not sure is selected OR never practices..."

3 replies

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • 488 replies
  • Answer
  • October 3, 2019
You need to add OR statements to your validation logic. Something like IF "Etner years of practice, text entry is greater than 0 or less than 30 OR Not sure is selected OR never practices..."

Forum|alt.badge.img+3
  • Author
  • Level 1 ●
  • 11 replies
  • October 3, 2019
Awesome. Problem solved. Could I ask one more thing here? How can I set a rule so the numeric entry can have max one decimal?

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • 488 replies
  • October 4, 2019
I think this can be done with a match regex function, but I am not certain.