Is there a way to format a question like the NPS questions format (see pic) with JavaScript? | XM Community
Skip to main content
Solved

Is there a way to format a question like the NPS questions format (see pic) with JavaScript?


Hi there,
I'm hoping someone here can help as I cannot work it out.
I am not interested in NPS score but I am using a 0-10 point scale in my survey and would like to format the question like the NPS.
Is there a way to do this using JavaScript?
Or perhaps I could just edit the NPS question text & labels (and ignore the NPS specific labelling in the data output ("detractor", "promotor" etc).
Thanks!
image.png

Best answer by TomG

Celine,
Your second idea, editing the NPS question and labels and ignoring detractor/promotor data, is the best and easiest solution.

View original

8 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21

Hi Celine
You could use the Multiple choice question type in horizontal position to achieve the same format as NPS.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5940 replies
  • Answer
  • May 20, 2020

Celine,
Your second idea, editing the NPS question and labels and ignoring detractor/promotor data, is the best and easiest solution.


  • Author
  • 6 replies
  • May 20, 2020

Thanks @PraDeepKotian_Ugam and TomG ! Really appreciate the suggestions.
@PraDeepKotian_Ugam, I did try that but it allows me to either only have labels (not at all likely, extremely likely) or the number labels (0, 1, 2...) - not both as in the NPS format.
I might just go with the editing the NPS question, it shouldn't mess up the data format, I hope.


Forum|alt.badge.img+2
  • 6 replies
  • June 30, 2020

I'm trying to do the same thing except I need to add a "No Experience" option after the "10" when I do so it adds a scroll bar to the responses (see below), which I'd like to remove. Is there a way to edit/format the answer choice boxes to fit all on one line? I would use the NPS and edit except I do need to add the extra answer option. Open to any ideas/suggestions. Thanks!
Currently using multiple choice, horizontal, single
image.png


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5940 replies
  • June 30, 2020

sam325 ,
You can't use NPS because it is limited to 11 choices (0-10).
With a MC, you can reduce the label padding and margin w/ CSS or JS to squeeze more choices in.


Forum|alt.badge.img+2
  • 6 replies
  • July 1, 2020

TomG Thanks for the response. Where do I put the code (question or answer choices) and what code should I use? Is there a site or list of steps to implement on this site or elsewhere? I've never done it before so not sure where to look. Thanks!


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5940 replies
  • July 1, 2020

sam325 ,
Try adding this JS to your question:
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" label.SingleAnswer").css("padding","5px");
});


Forum|alt.badge.img+2
  • 6 replies
  • July 7, 2020

Thanks TomG! It worked perfectly!


Leave a Reply