Welcome to the LimeSurvey Community Forum

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

per-question JavaScript in version 4?

  • zaorivee
  • zaorivee's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago - 3 years 10 months ago #200113 by zaorivee
per-question JavaScript in version 4? was created by zaorivee
I want to add JavaScript to a particular question in my survey.

Based on searching the web, it seems like a plugin is required to support this functionality.

I found this plugin:

extensions.sondages.pro/questions-updati...sily-add-javascript/

I downloaded this plugin, but when I went to activate it in the admin interface, the plugin is not recognized as compatible with version 4. "Plugin is not compatible with your LimeSurvey version."

I am running version 4.2.4+200520

Perhaps the plugin is declaring compatibility in an overly strict manner? Has the plugin interface changed in version 4? Does anyone have experience with this particular plugin?

Or, alternatively, is there another way to support per-question JavaScript in the current version of LimeSurvey?
Last edit: 3 years 10 months ago by zaorivee.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200116 by holch
Replied by holch on topic per-question JavaScript in version 4?
There is no need for a plugin to insert Javascript into a Limesurvey question.

The plugin provides only a separate field to put the Javascript, which is cleaner and avoids trouble with the WYSIWYG-Editor in the fields for the question text.

However, you can also just include your Javascript into the field for the question itself, if you include it in the source mode of the WYISWYG-Editor or switch the Editor off (which I generally do).

If I recall right, in LS 4, this field for Javascript that was created by this plugin is even standard.

Here you go, the field created by this plugin is already there in the standard interface in 4.x, so I am quite sure there will be no update for this plugin, as it is not needed anymore:



However, for Javascript to work in your survey, you need to switch off the XSS filter.

There is even a whole section in the manual on how to use Javascript in LS surveys:
manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose