Welcome to the LimeSurvey Community Forum

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

JavaScript in Question Editor gets removed

More
6 years 9 months ago - 6 years 9 months ago #176653 by TRCBerlin
Hey folks,


LimeSurvey version: 3.13.1+180629
Browser: Mozilla Firefox 60.3.0esr (32-Bit)

I use a java script to switch the text style to password. It always worked until now. At first the script was completely gone, I pasted it once again, but when I saved and closed the editor parts of the script were missing and it is displayed as plain text.

This is the script:
Code:
<script type='text/javascript' charset='utf-8'>
 
  $( document ).ready( function() {
    // self.sgqa ist der Identifier für das Antwortfeld. my_targetTextBox gibt die ID jquery-konform wieder
  var this_self='{self.sgqa}';
  var my_targetTextBox='#answer' + this_self;
 
    // ändert den Texttypen auf Passwort
  $( my_targetTextBox ).attr( 'type', 'password' );
});
</script>

I searched through the forums, if anyone else experienced similar issues, but did not find anything related to it. Neither did I find any configurations in my survey, that might be responsible for this issue.

Screenshots are attached, showing how it looks like before and after I save the question





Any help how to enable the script once again is much appreciated!
Last edit: 6 years 9 months ago by TRCBerlin. Reason: double pasted the code
The topic has been locked.
More
6 years 9 months ago #176655 by holch
Did you set up your survey for being able to use Javascript according to the manual?

www.limesurvey.org/manual/Workarounds:_M...tc..29_in_LimeSurvey

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose