enable respondent to add extra response fields
Hi. I am trying to survey the pains customers experience with a certain product and my survey is set up to collect open text responses. As I can't anticipate the number of text entries that each respondent might want to provide, I'm using a form-type question with multiple open text fields. The drawback with this is that it makes the survey experience a bit off-putting since five open text fields can feel daunting. I'm wondering if there's a way to allow respondents to self-determine the number of text entries when they take the survey? Rather than predefining the number of responses that everyone might provide, imagine a button of some sort that the respondent could click to add extra response fields as necessary. Is there a solution for this?
Page 2 / 2
I'm sure the code could be modified to work with form fields but I don't really know Javascript. Good luck!
Ok @uhrxx005. Got it working now. The matrix table is not ideal for my usage situation, but it's the closest I've come to a solution so far. Thanks.
In the survey builder you will have to set the matrix row number to be the max number you want to allow, then in the code you determine how many are visible before the button. You can also change what the button says.
@uhrxx005. Ok this seems a bit better. The code produces a button, but the button does not do anything.
!
!
I just took a closer look. I believe you have to set it up as a text entry matrix question instead of a form field.
Hi @Kate. Your solution can maybe work as a workaround if I don't figure this out. Thanks for the input!
Thanks for the input @uhrxx005. Tested your code in the .addOnReady section, but I can't seem to get it to work. Nothing happens...
I have used this code that I found on the community awhile back for a similar problem. It adds a button to the form field that participants can press to make more fields.
Qualtrics.SurveyEngine.addOnReady(function()
{
var that=this.questionId;
jQuery("#"+this.questionId+" tr.ChoiceRow:not(:lt(3))").hide();
jQuery("<input type='button' id='add' value='Add Client' name='+' />").insertAfter("#"+this.questionId+" tr.ChoiceRow:last");
jQuery("#add").on('click',function(){
var c= jQuery("tr.ChoiceRow:visible").length;
jQuery("#"+that+" tr.ChoiceRow:eq("+c+")").show();
});
});
Qualtrics.SurveyEngine.addOnReady(function()
{
var that=this.questionId;
jQuery("#"+this.questionId+" tr.ChoiceRow:not(:lt(3))").hide();
jQuery("<input type='button' id='add' value='Add Client' name='+' />").insertAfter("#"+this.questionId+" tr.ChoiceRow:last");
jQuery("#add").on('click',function(){
var c= jQuery("tr.ChoiceRow:visible").length;
jQuery("#"+that+" tr.ChoiceRow:eq("+c+")").show();
});
});
I have something similar in one of my surveys but... IDK if it will apply here.
What I do in an early question is ask a respondent, "How many Contracts would you like to tell me about?" and they select a number from a drop down menu. Then the following questions are for Contract 1, Contract 2, etc.. and I simply display the additional information using the Question Display logic that if Q1 =1, then show Contract 1. If Q1=2, then show Contract 1 and 2.
This may or may not work for you. But I thought I'd share!
What I do in an early question is ask a respondent, "How many Contracts would you like to tell me about?" and they select a number from a drop down menu. Then the following questions are for Contract 1, Contract 2, etc.. and I simply display the additional information using the Question Display logic that if Q1 =1, then show Contract 1. If Q1=2, then show Contract 1 and 2.
This may or may not work for you. But I thought I'd share!
Page 2 / 2
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.