enable respondent to add extra response fields | XM Community
Question

enable respondent to add extra response fields



Show first post

34 replies

Badge +1

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

Userlevel 1
Badge +2

Ah sorry, I misunderstood.

Badge +1

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.

Userlevel 1
Badge +2

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

Badge +1

Thank you el_ , that worked perfectly.

Badge

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.

Badge

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?

Userlevel 3
Badge +11

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

Badge +1

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