Custom validation for Text Box in Side-By-Side Matrix | XM Community
Question

Custom validation for Text Box in Side-By-Side Matrix

  • 18 June 2019
  • 1 reply
  • 25 views

I have 14 different questions , each is Side-By-Side Matrix table with Drop-Down boxes and a Comment fields to rank our banking partner across 5 different regions.
Ranking choice is from 0 to 3 in the increment of 0.25 and 'NA'
In general Comment field is optional but I will like to make it mandatory if user rank is below 1.5 (Low Ranking) or above 2.5 (High Ranking) .
I was able to do this using custom validation but it was very cumbersome and had to repeat it for all 14 questions as there was no way to copy paste.

I will like to know if there is a better way to do with Java Script so I can
1. Easily copy paste validation logic across all the Questions if I ever need to add/change validation logic.
2. May be disable 'Next' button until mandatory comments are entered based on the drop-down list value selected.
3. Add some kind of visual aid to user to know that comments are mandatory by changing the border color to RED based on drop down value selected.

Here is the image displaying what each question look like.
!

Any guidance is appreciated.

1 reply

I am looking for the same solution. Did you ever get a solution?

Leave a Reply