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

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

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


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


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.


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


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.


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!


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


Thanks TomG! It worked perfectly!


Leave a Reply