Distinguish 0 v/s 'Not Applicable' choice in slider | XM Community
Skip to main content
Solved

Distinguish 0 v/s 'Not Applicable' choice in slider

  • March 26, 2019
  • 5 replies
  • 147 views

I have a slider with numeric choices from 0 to 4 in the increment of 0.5. I also have 'Not Applicable' option turned on. In the very next question I have custom validation. User must provide comments if user selected value in slider is less than 1 or Greater then 3. No validation is required if user selects 'Not Applicable' However it seems my validation is failing when user selects 'Not Applicable' since the choice value is coming up as zero. How to distinguish user selected 0 value v/s 'Not Applicable' selection in Slider ? I am trying to avoid Java Scripts.

Best answer by TomG

@Amar, Not Applicable results in a empty value. So, I think you should turn on force response on your slider and the validation should be something like: If comment not empty OR (new logic set) If slider is empty OR slider >= 1 AND slider <=3

5 replies

Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • 543 replies
  • March 27, 2019
Is there are reason you need it to be a slider? 1) "Not applicable" on a slider is really confusing for participants; they are most frequently used when the only options are on one full spectrum, not for options that have separate categories. 2) This logic should be very simpler utilizing a regular multiple choice question and recode values. Slider will not let you re-code "Not Applicable" into a new value, or allow you to "exclude from analysis" due to the conventions mentioned in my first point.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • Answer
  • March 27, 2019
@Amar, Not Applicable results in a empty value. So, I think you should turn on force response on your slider and the validation should be something like: If comment not empty OR (new logic set) If slider is empty OR slider >= 1 AND slider <=3

  • Author
  • 4 replies
  • March 27, 2019
Kate & TomG, Thanks for your feedback. I am using slider because some of our users thought it is mobile friendly. I am exploring other options as well. TomG, I did used 'Not Empty' check in my validation and it seems to work. By any chance you will know how I can do similar validation in Java Script ? I have not used Java script yet but will like to give it a try. It seems Java script open up lot more possibilities. Thanks in advance for your help. Amar

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • March 27, 2019
> @Amar said: > By any chance you will know how I can do similar validation in Java Script ? > I have not used Java script yet but will like to give it a try. It seems Java script open up lot more possibilities. You can do a lot of things with JavaScript, but it isn't well suited to doing validation in this specific case. You are better off using custom validation.

  • Author
  • 4 replies
  • March 28, 2019
In the 2nd question, I want to set some Embedded Data values based on user selection in the previous question. It may will help in another part of the survey as well as generating dynamic messages. Java script may help. How can I access previous question information and user selection using Question ID. Previous Question must be displayed on the same page in order to do that ?