I have seen a few posts about this already but my rows are randomized so I cannot just go to a specific row and hide a scale point. I have a 0-10 satisfaction scale with a Not applicable. I have close to 20+ rows and I only need to enable the "Not applicable" to 4 of them. How can I do this if rows are randomized?
Instead of custom code, we can also use custom validation and add validation as for those other 16 rows "Not applicable is not selected"
Add those text in span class with some class name (like in below code "op1, op2, op3..") where you need to show the radio buttons and do not add any span class for other options
And add the below codes as per your matrix layout,
// If you have applied border to matrix question
jQuery('tbody tr').find('td:last-child').each(function(){
jQuery(this).find('.q-radio').css('visibility','hidden')
})
jQuery('.op1').closest('tr').find('td:last-child').find('.q-radio').css('visibility','visible')
jQuery('.op2').closest('tr').find('td:last-child').find('.q-radio').css('visibility','visible')
jQuery('.op3').closest('tr').find('td:last-child').find('.q-radio').css('visibility','visible')
jQuery('.op4').closest('tr').find('td:last-child').find('.q-radio').css('visibility','visible')
// If you don't borders applied to matrix question
jQuery('tbody tr').find('td:last-child').each(function(){
jQuery(this).css('visibility','hidden')
})
jQuery('.op1').closest('tr').find('td:last-child').css('visibility','visible')
jQuery('.op2').closest('tr').find('td:last-child').css('visibility','visible')
jQuery('.op3').closest('tr').find('td:last-child').css('visibility','visible')
jQuery('.op4').closest('tr').find('td:last-child').css('visibility','visible')
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.