Error message in javascript | XM Community
Skip to main content
Solved

Error message in javascript

  • November 11, 2018
  • 2 replies
  • 351 views

Christoph
Forum|alt.badge.img+2
I am trying to implement http://mgto.org/quick-qualtrics-tricks-3-scale-results-calculation/ for the SF-36 (a standard physical and mental health questionnaire). I get an error when I add the javascript setting a variable to an answer from a survey question. This leads to an error message on saving of the javascript of "Invalid JavaScript! You cannot save until you fix all errors: Unexpected token { Qualtrics.SurveyEngine.addOnload(function() { var pf1 = ${q://QID13/ChoiceDescription/1}; }); Could anybody advise?

Best answer by Anonymous

Hello @Christoph , Put the piped text in double quotes as shown below: `var pf1 = "${q://QID13/ChoiceDescription/1}";`

2 replies

  • Answer
  • November 11, 2018
Hello @Christoph , Put the piped text in double quotes as shown below: `var pf1 = "${q://QID13/ChoiceDescription/1}";`

Christoph
Forum|alt.badge.img+2
  • Author
  • November 12, 2018
Thank you! A small thing but really helpful.