Highlight row for the invalid answer | XM Community
Solved

Highlight row for the invalid answer

  • 29 June 2020
  • 2 replies
  • 21 views

Userlevel 5
Badge +4
  • QPN Level 3 ●●●
  • 181 replies

Hi,
Is there any way to highlight the row where the respondent have entered the invalid value or is there any way we can highlight the row where answer is missing in the matrix question.
For example, I have matrix question with text entry and I want to highlight the row where I have entered the invalid value in it. In the below example,I have entered the invalid value for the second option and want to highlight that row, I need this because in my matrix question there are no of statements with columns and want to highlight the respected row with invalid answer or not answered.
Any help would be appreciated.

image.png


icon

Best answer by rondev 29 June 2020, 23:12

View original

2 replies

Userlevel 7
Badge +22

Try the below code:
var that = this.questionId;
jQuery("#"+that+" input[type='text']").each(function(){

if(isNaN(jQuery(this).val()) || parseInt(jQuery(this).val())>100){


jQuery(this).parent().parent().css("background-color","#FA8072");

}


});

jQuery("#"+that+" input[type='text']").on('input',function(){

jQuery(this).parent().parent().css("background-color","");
});

Userlevel 5
Badge +4

https://www.qualtrics.com/community/discussion/comment/27350#Comment_27350Thank you rondev , this worked, I'll adjust the code for matrix single answer question.

Leave a Reply