Welcome to the LimeSurvey Community Forum

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

Accessing groupname via JavaScript

  • NMH1337
  • NMH1337's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 10 months ago #222998 by NMH1337
Accessing groupname via JavaScript was created by NMH1337
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.27.20+211012
Own server or LimeSurvey hosting: own server
Theme: custom_theme

==================
Hi,
Im currently working on a custom theme with different timelimits for question groups.
For that i added a script with a timelimit for each group "<input name="time" type="hidden" value="270" />".
Im using cookies to save the current timer linked to the question group.
For that i need to access the current question group name with javascript is there any way to do that?

thanks for your help :)
 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #223008 by tpartner
Replied by tpartner on topic Accessing groupname via JavaScript
Where have you placed the JavaScript?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • NMH1337
  • NMH1337's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 10 months ago #223009 by NMH1337
Replied by NMH1337 on topic Accessing groupname via JavaScript
Hi thanks for replying
I added the Script at the end of "layout_global.twig" so there should be a way that the templating system can call the attributes.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #223015 by tpartner
Replied by tpartner on topic Accessing groupname via JavaScript
You can use the processString() function in TWIG files - www.limesurvey.org/manual/Theme_editor_-...lable_Twig_functions

Code:
{{ processString('{GROUPNAME}') }}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: NMH1337
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose