Home arrow Ondersteuning arrow Forums
LimeSurvey Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Information from tokens table (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: Information from tokens table
#19012
henryhund (User)
Fresh Lemon
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Information from tokens table 2 Months ago Karma: 0  
Limesurvey Version 1.71+ (5246)

I would like to use information from my tokens table, as described in the manual (docs.limesurvey.org/tiki-index.php?page=...on_from_tokens_table).

In order to do so, I typed the following sample code into the "Question" section of one of my questions:
My Question?<startscript>if {TOKEN:ATTRIBUTE_1}='worker' then write 'bosses' else write 'workers'<endscript>

Unfortunately, the script code is not executed, but rather displayed as text. When I execute my survey (in closed mode, with tokens defined) or preview the question or edit the question again, I see the following:
My Question?ript />if {TOKEN:ATTRIBUTE_1}='worker' then write 'bosses' else write 'workers'ript />

Could anyone please let me know how I can ensure that the script code will be executed instead of being displayed as text?

Thanks a lot in advance!
 
Logged Logged  
  The administrator has disabled public write access.
#19013
ElMatador69 (Moderator)
LimeSurvey Team
Posts: 1577
graphgraph
User Offline Click here to see the profile of this user
Re:Information from tokens table 2 Months ago Karma: 31  
Hi, I suggest to upgrade your LimeSurvey installation to the latest build and then use the buildin wizard "LimeReplacementField".
 
Logged Logged  
 
Last Edit: 2008/09/19 10:50 By ElMatador69.
 
Get in touch with the LimeSurvey Development Team via IRC
If our informations and answers were useful to you, please consider a donation to the LimeSurvey Project!
  The administrator has disabled public write access.
#19014
henryhund (User)
Fresh Lemon
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Re:Information from tokens table 2 Months ago Karma: 0  
Thanks for your answer.

Given the fact that the feature I intend to use seems to be fairly common, is there any other solution to this problem besides upgrading?
 
Logged Logged  
  The administrator has disabled public write access.
#19020
Mazi (Moderator)
Moderator Lime
Posts: 3262
graph
User Offline Click here to see the profile of this user
Re:Information from tokens table 2 Months ago Karma: 25  
The placeholder should only be used to display certain text blocks. I'm not sure if you can use them within other script. To enable scripting you have to disable the XSS filter. Search for a setting like "xssfilter" in config-defaults.php and copy it to config.php; then disable it.

Nevertheless I doubt that it will work the way you try to use it.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
Go to top