Hi
I am sure there is an easy fix to this but somehow I couldn't figure it out: In a matrix item, how can I have all boxes selected (so respondents have to un-select instead of select). I know I can manually select all boxes through "Add Default Choices.." but because I have to do it for many items, I hope there is an automatic way?
Thanks in advance
Page 1 / 1
Hi @automaticadd,
you can do it automatically using JavaScript. You can set the value using `setChoiceValueByRecodeValue` function and repeat it for all rows and columns of your matrix using, for example, a nested for loop. Unfortunately, I don't know how to get the number of rows and columns automatically, so I defined it manually. Here is an example code for 3 x 3 matrix.
Qualtrics.SurveyEngine.addOnload(function()
{
var i;
var j;
for (j = 1; j <= 3; j++) {
for (i = 1; i <= 3; i++) {this.setChoiceValueByRecodeValue(j, i, true);}
}
});
you can do it automatically using JavaScript. You can set the value using `setChoiceValueByRecodeValue` function and repeat it for all rows and columns of your matrix using, for example, a nested for loop. Unfortunately, I don't know how to get the number of rows and columns automatically, so I defined it manually. Here is an example code for 3 x 3 matrix.
Qualtrics.SurveyEngine.addOnload(function()
{
var i;
var j;
for (j = 1; j <= 3; j++) {
for (i = 1; i <= 3; i++) {this.setChoiceValueByRecodeValue(j, i, true);}
}
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.