Welcome to the LimeSurvey Community Forum

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

INSERTANS in custom.js

More
3 years 6 months ago #221191 by rola
INSERTANS in custom.js was created by rola
Hi,
In LS version 2.06 I used to assign INSERTANS to one variable within a javascript snippet in navigator.pstpl file of the survey theme, so that I can read the value across all survey groups. such as 
Code:
<script>
$(document).ready(function(){   
    var partOpt='{INSERTANS:314875X257X1549}';
    if (partOpt =='xxx') {
      // action if true
    }
    else{
       // action if false
    }
 
   });
</script>

currently I am using LS version 5, and using same snippet in custom.js didn't render the right value to partOpt variable. any idea how to apply same code in the new LS version ?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 6 months ago #221192 by DenisChenu
Replied by DenisChenu on topic INSERTANS in custom.js
You can not use expression manager inside custom.js

You can use it in twig with www.limesurvey.org/manual/Theme_editor_-...ctions#processString

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: tpartner
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose