Welcome, Guest
Username: Password: Remember me

TOPIC: Suddenly not possible to enter javascript code

Suddenly not possible to enter javascript code 2 years 1 month ago #75974

  • kagerskov
  • kagerskov's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
I am using javascript and have done it succesfully by adding script code in the question text field.

But suddenly it is not possible anymore. When I click the update questiontext button it shows a blank internet explorer page. And the entered data has not been saved. I have tried putting in only the script tags to make sure that it was not a coding error but same result. If I remove the script tag it saves normally.

The Filter HTML for XSS" is set to "Off" as it should.

Any help is greatly appriciated!!!
The administrator has disabled public write access.

Re: Suddenly not possible to enter javascript code 2 years 1 month ago #76002

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
Which version are you using?

Please paste a sample of the JavaScript code having trouble.

If you are using 1.92, you need to check your JavaScript code for two things:

(1) all opening curly braces must have a whitespace (a space, tab, or newline) after them, and all closing curly braces must have whitespace before them (otherwise Expression Manager will think that your JavaSript code should be parsed as an Expression, and it will say that your variables are not defined.

(2) If you do any regular expression parsing within JavaScript, and your regular expressions use curly braces (like us_phone.match(/\d{3}-\d{3}-\d{4}/)), you can not use the in-line regular expression syntax. You must create a a new RegExp() object like this RegExp('/\d{3}-\d{3}-\d{4}/') and use it in the matching, otherwise Expression Manager will think that you are trying to evaluate {3}

/Tom
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.107 seconds
Donation Image