enable respondent to add extra response fields | XM Community
Skip to main content
Question

enable respondent to add extra response fields


Show first post

34 replies

Forum|alt.badge.img+1
  • 9 replies
  • March 8, 2022

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


Forum|alt.badge.img+2
  • 25 replies
  • March 8, 2022

Ah sorry, I misunderstood.


Forum|alt.badge.img+1
  • 9 replies
  • March 8, 2022

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.


Forum|alt.badge.img+2
  • 25 replies
  • March 8, 2022

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


Forum|alt.badge.img+1
  • 9 replies
  • March 8, 2022

Thank you el_ , that worked perfectly.


Forum|alt.badge.img
  • 1 reply
  • March 11, 2022

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.


Forum|alt.badge.img
  • 1 reply
  • May 31, 2022

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?


Umang Upadhyay
QPN Level 4 ●●●●
Forum|alt.badge.img+20
  • QPN Level 4 ●●●●
  • 117 replies
  • December 13, 2023

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


Forum|alt.badge.img+1
  • 3 replies
  • December 14, 2023

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