enable respondent to add extra response fields | XM Community
Question

enable respondent to add extra response fields



Show first post

34 replies

Badge +1

It works now but after the 5 visible answer fields, when you click button it adds no. 8, 9,10. it skips 6 and 7, I wonder why?

Userlevel 1
Badge +2

How many fields do you give? This can be seen here, number of fields:
image.png

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

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