Custom validation for Text Box in Side-By-Side Matrix table with Drop Down box and Text Box | XM Community
Solved

Custom validation for Text Box in Side-By-Side Matrix table with Drop Down box and Text Box


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.
icon

Best answer by Amar 10 January 2020, 15:18

View original

2 replies

@Amar

How were you able to place a drop down list next to a text box?
This is a outof box functionality.

Select question type as 'Side-by-Side'
And select option 'Drop Down List' from 'Column Options' for the first column and 'Open Ended Text' for the second column.
For Open Ended Text, you will have otption for Short, Medium, Long or Essay depending on the type of input you expect from the survey taker.

Hope this helps.

Leave a Reply