Error message in javascript | XM Community
Solved

Error message in javascript

  • 11 November 2018
  • 2 replies
  • 221 views

Badge +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?
icon

Best answer by Anonymous 11 November 2018, 22:43

View original

2 replies

Hello @Christoph ,

Put the piped text in double quotes as shown below:

`var pf1 = "${q://QID13/ChoiceDescription/1}";`
Badge +2
Thank you! A small thing but really helpful.

Leave a Reply