Welcome, Guest
Username: Password:

TOPIC: Can't add javascript to a question

Can't add javascript to a question 4 years 1 month ago #78918

  • asklepio
  • asklepio's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Hi,

I'm a newbie, and i want add javascript code to a question I created.
so i added this under "source"
Question...
<script type="text/javascript" charset="utf-8">

alert("Test!");

</script>

I saved it and when i edit de question again, this is what i get:
Question... <sc<x>ript type="text/javascript" charset="utf-8"> alert("Test!"); </sc<x>
and the javascript is not working..

Did i forget anything before adding javascript?
thanks!
The administrator has disabled public write access.

Can't add javascript to a question 4 years 1 month ago #78920

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1710
  • Thank you received: 424
  • Karma: 106
Set the 'Filter HTML for XSS' option to 'no'
Path: Global Settings > SECURITY > Filter HTML for XSS

Ben/
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu, asklepio

Can't add javascript to a question 4 years 1 month ago #78930

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5964
  • Thank you received: 363
  • Karma: 259
For more information on how to add Javascript to a survey, have a look at the blog post on www.limesurvey-consulting.com:
How to use JavaScript at a Limesurvey template or survey

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.212 seconds