I have a matrix table where I'm asking respondents to indicate the ways in which they consume particular products. The question is set up so that the products are Statements (carried forward from a previous question), and the Scale Points are the format(s) in which they use the product.
The issue I'm having is that not all scale points are applicable to every statement - for example, using a web-based product in a printed format.
Is there a way I can use custom Javascript to hide the scale points that don't apply for affected products? (Of course, if there's an easier method to hide these wihtout resorting to JS I'd be happy to hear about that too!)
Page 1 / 1
Hey,
Could you please add below code to your javascript editor and make the adjustment accordingly. In the below code I have only disabled 5th option for 1 row, if you want it for few more rows then you can copy the code for 2nd row as well. Please let me know if any difficulty.
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("tbody .ChoiceRow").eq(0).find("td").each(function(index) // change eq value as per your requirement, here i Have used only first row
{
if(index==4) // here i have disabled only 5th option. you can add muliple as if(index==4 || index==6 || index==7) etc.
{
$j(this).find("input[type=radio]:not(:checked)").prop("disabled", true);
}
});
});
Could you please add below code to your javascript editor and make the adjustment accordingly. In the below code I have only disabled 5th option for 1 row, if you want it for few more rows then you can copy the code for 2nd row as well. Please let me know if any difficulty.
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("tbody .ChoiceRow").eq(0).find("td").each(function(index) // change eq value as per your requirement, here i Have used only first row
{
if(index==4) // here i have disabled only 5th option. you can add muliple as if(index==4 || index==6 || index==7) etc.
{
$j(this).find("input[type=radio]:not(:checked)").prop("disabled", true);
}
});
});
How does this work if rows are randomized and the only way I can identify which ones to hide is by the recode value?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.