Highlight row for the invalid answer

SurajKSurajK IndiaCommunity Member Sage ✭✭✭
edited June 2020 in Custom Code

Highlight row for the invalid answer

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.



Best Answer

  • rondevrondev Community Member - Trial User Wizard ✭✭✭✭✭
    Accepted Answer

    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","");
    	});
    


Answers

Sign In to Comment