JS overriding entries in Response Summary | XM Community
Skip to main content
Solved

JS overriding entries in Response Summary

  • December 4, 2020
  • 4 replies
  • 16 views

I am using the JS below to remove the zeros from Constant Sum questions for easy completion for respondents.
jQuery("#"+this.questionId+" input[type=text]").val("");
But no entries in these questions are displaying in the Response Summary now.
Help please.

Best answer by TomG

Qualtrics.SurveyEngine.addOnPageSubmit(function() {
jQuery("#"+this.questionId+" input[type=text]").each(function(){if(this.value.length==0) this.value="0";});
});

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • December 5, 2020

You can add an addOnPageSubmit function to change the blanks back to zero when the respondent clicks the next button.


  • Author
  • 3 replies
  • December 6, 2020

Thanks TomG,
Would the addOnPageSubmit function then show entries in the Response Summary?
If so, is this addOnPageSubmit function JS?
Could you kindly share what that should look like?
Thank you


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • Answer
  • December 6, 2020

Qualtrics.SurveyEngine.addOnPageSubmit(function() {
jQuery("#"+this.questionId+" input[type=text]").each(function(){if(this.value.length==0) this.value="0";});
});


  • Author
  • 3 replies
  • December 6, 2020

Thank you very much TomG, unfortunately this hasn't solved my problem yet.
Below is a copy of my question in Editor, Response Summary (blank although numbers entered) and in Data and Analysis (numbers displayed).
image.pngimage.pngimage.pngimage.png