disable editing in constant sum question with default choices | XM Community
Skip to main content

My form is a survey here respondents will enter scores in text entry box. At the end of the questions, they will see a summary of the scores they entered in the constant sum display. So i created the constant sum question ( Question type: Constant Sum, Answer type: Choices) question and inserted the score entries from the text boxes using default choices. 

Now i want to disable the text boxes in the constant sum such that if they want to make changes to their scores they will have to go back to the text entry where they entered the score instead of editing the score in the constant sum box. 

 

I hope this clarifies things

@Deepak i created a new post for it. Can you assist me here please?


@Bee 

Try below code:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var n= jQuery("#"+this.questionId+" .InputText").length; for (let i=0;i<n;i++)

{jQuery("#"+this.questionId+" .InputText").eq(i).prop('disabled',true);}
});

Hope it helps!


It Worked! Thank You soo much @Deepak 😊


@Bee 

Glad it worked kindly accept the answer.

Hope it helps!


@Bee

Try below code:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var n= jQuery("#"+this.questionId+" .InputText").length; for (let i=0;i<n;i++)

{jQuery("#"+this.questionId+" .InputText").eq(i).prop('disabled',true);}
});

Hope it helps!

@Deepak this disabled editing of all the three statements in the question. I have a constant sum question where I have a piped in choice for the first option but need the participant to be able to add amounts statements 2 and 3. So, ONLY the number piped in from the previous question should be disabled from editing while the other two are open for entry. How do I edit the script to do that?


@Rajiv Vaidyanathan 

In place of n replace it with 1 in code and try. Something like

Qualtrics.SurveyEngine.addOnload(function()

{

 /*Place your JavaScript here to run when the page loads*/

var n= jQuery("#"+this.questionId+" .InputText").length; for (let i=0;i<1;i++)

 

{jQuery("#"+this.questionId+" .InputText").eq(i).prop('disabled',true);}

});


@Deepak 

That worked!

Thank you. You are a genius and I greatly appreciate your assistance.


Leave a Reply