Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Using Javascript

  • perryworld
  • perryworld's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #122081 by perryworld
Using Javascript was created by perryworld
Hi,

We are totally new to LimeSurvey and have a question about using javascript.
We found an example on how to use javascript and when we had version 2.05 we could go to configuration and switch the HTML to XSS setting to "no". We are now using 2.06 and when we try to change it to "no" it reverts back to "yes" and we are not able to set it.
Is there something we are missing?

Also, when we put javascript code in the source of a question it seems to work but if we try to run a function that has been saved in template.js it doesnt seem to run it. Would that be related to the setting above?

Any help would really be appreciated.

Thanks
Richard
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #122097 by DenisChenu
Replied by DenisChenu on topic Using Javascript

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • perryworld
  • perryworld's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #122104 by perryworld
Replied by perryworld on topic Using Javascript
Hi DenisChenu

Thanks for the quick reply.
We updated the code and that has fixed the HTML to XSS issue - Thanks

Will this solve the problem of being unable to run javascript in the template.js?
We seem to be able to run javascript included in the question but it didn't seem to work if we had the functions in the template.js

Cheers
Richard
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 8 months ago #122123 by Mazi
Replied by Mazi on topic Using Javascript
It should make no difference whether the JS is placed at the template.js or the question. Only when using placeholders like {QID} within the script, it will not work when being placed at the template because the placeholder refers to a certain question.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • perryworld
  • perryworld's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #122261 by perryworld
Replied by perryworld on topic Using Javascript
Thanks Mazi,

We pass the QID to the function so think it should work.
We will try it again to see why it didn't

Cheers
Richard
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose