enable respondent to add extra response fields | XM Community
Skip to main content
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?

I give 10 fields. please check if the code is good.


Ah sorry, I misunderstood.


el_ . Sorry to bother. Thanks for the suggestion to include page breaks, now my button works.
My new question is; if I set the javascript to show 3 form fields, the click button starts adding more fields from no. 6, 7 up to 10 (I set the form fields at 10 in the survey editor). If I set the javascript to show 5, then the button starts adding from 8,9, up to 10. I wonder what is wrong in my code that this error persists?
This problem is in the main survey preview and not when I preview the individual question.


I remember that simultaneously back then I asked the question on stack overflow, this was the answer that I received, maybe this script works better for you?

https://stackoverflow.com/questions/71050727/add-choice-button-for-respondents-in-qualtrics


Thank you el_ , that worked perfectly.


If you want a work around that doesn't involve coding, you can actually do the exact same thing the code does, by creating the fields ahead of time, and under each question ask if they would like to add another response. Just use display/skip logic (whichever you prefer) and jump ahead until the respondent says "no" to add another response. I've done this with applications where I ask the student to provide information about a reference e.g. name, email, relationship, etc., and at the end of each reference I ask if they would like to add another. I usually only make space for 4 references since most students submit 2 or 3.


I am trying to build a matrix question (open text) where participants are able to add more scale points. The code in the link below worked perfectly for building an "add options" button
https://stackoverflow.com/questions/71050727/add-choice-button-for-respondents-in-qualtrics?newreg=2924a33cde814581971f5d0ea2918083 
But, I want the respondent to be able to edit the added options. Here is what it looks like now:
Screen Shot 2022-05-31 at 16.10.15.png
Qualtrics expects me to write the text in the first column. How do I allow the participant to write in the first column instead?


Do we have a limit as well here to the number of fields added that we can set


Hi, aware this is an old thread. Just wondering if it is possible to add this button for “Constant Sum” type question.

Currently the code I’m using works for form field, but I’d like it to work for constant sum. Thanks!

Code: 

Qualtrics.SurveyEngine.addOnload(function() {
    var cs = jQuery("#"+this.questionId+" .ChoiceStructure");
    cs.find("tr:not(:lt(1))").hide();
    cs.append("<input type='button' id='add' value='Add Additional Activity' name='+' />");
    jQuery("#add").on('click',function(){
        var c = cs.find("tr:visible").length;
        cs.find("tr:eq("+c+")").show(); 
    });
});


Leave a Reply