I designed a Qualtrics survey which includes a text entry question. I used a form here and it contained 10 text entry boxes. I want participants to fill in at least 5 boxes (any 5 boxes out the 10 is okay). I don't think validation is a good idea because there are so many possible cases when you complete at least 5 text boxes out of 10. For every text box, both filling in it and not filling it are okay, as long as the total competed text boxes are no less than 5.
So I tried to do this through javascript. And here is my code but it cannot work. Please tell me how to change it. Thanks!!
Qualtrics.SurveyEngine.addOnload(function()
{
//disables the next button on the page
this.disableNextButton();
var choicesID=this.getQuestionInfo().Choices.Key
while (1)
{
var t=0
for (var i=0;i<choicesID.length;i++)
{
choicetext=this.getTextValue(choicesID[i])
if (choicetext.length != 0)
{
t=t+1
}
}
if (t<=4) continue;
}
this.enableNextButton();
});