- Posts: 13
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Is it possible to pass the token in the url and store as a hidden field?
- dataguru
- Topic Author
- Offline
- New Member
Less
More
12 years 7 months ago #64263
by dataguru
Replied by dataguru on topic Is it possible to pass the token in the url and store as a hidden field?
I added it to both question groups, altered it just a little and it works perfectly!
Thanks again for your assistance!
FYI, I think our IT department is going to start using LS as well. Now I just have to try and figure out how to get a donation made to help support this project.
Betty
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Find the survey ID if($('input#fieldnames').length != 0) { var fieldNames = $('input#fieldnames').attr('value'); var tmp = fieldNames.split('X'); var sID = tmp[0]; } // Insert a new div after the progress bar $('<div id="optOutLink" />').insertBefore('#progress-wrapper'); // Style the new div $('#optOutLink').css({ 'text-align':'center' }); // Insert opt out url in the new div $('#optOutLink').html('<P><a href="optout.php?lang=en&sid='+sID+'&token={TOKEN}">Click here to opt out of this survey.</a></p><br>'); }); </script>
Thanks again for your assistance!
FYI, I think our IT department is going to start using LS as well. Now I just have to try and figure out how to get a donation made to help support this project.
Betty
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
12 years 7 months ago #64283
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Is it possible to pass the token in the url and store as a hidden field?
You're welcome.
You may want to change <P> to <p>. IE sometimes gets confused by uppercase tags.
You may want to change <P> to <p>. IE sometimes gets confused by uppercase tags.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- dataguru
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
12 years 7 months ago #64291
by dataguru
Replied by dataguru on topic Is it possible to pass the token in the url and store as a hidden field?
Thanks Tony.
The topic has been locked.
- f1refly
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
7 years 5 months ago #142180
by f1refly
Replied by f1refly on topic Is it possible to pass the token in the url and store as a hidden field?
I am trying to do this same thing with an opt out link. How would it be accomplished in the current version (2.52?)
I have copied the javascript to the source description of my group. But I don't see a link. I think that there is no longer a #progress-wrapper. I would be happy with the opt out link in the description.
Any pointers?
I have copied the javascript to the source description of my group. But I don't see a link. I think that there is no longer a #progress-wrapper. I would be happy with the opt out link in the description.
Any pointers?
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 5 months ago #142197
by jelo
Nobody likes to dig through old stuff to grasp the status quo of the discussion.
If you just need a URL with a token on every page of the survey you can try to add the link directly to the template.
The token placeholder should be possible to add to the template as well. Haven't tested it on my own.
If you need the URL only on certain pages it depends on the position of the URL which way to go.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Is it possible to pass the token in the url and store as a hidden field?
To add your post to an old and long thread can minimize the chance for answers.f1refly wrote: I am trying to do this same thing with an opt out link. How would it be accomplished in the current version (2.52?)
Nobody likes to dig through old stuff to grasp the status quo of the discussion.
If you just need a URL with a token on every page of the survey you can try to add the link directly to the template.
The token placeholder should be possible to add to the template as well. Haven't tested it on my own.
If you need the URL only on certain pages it depends on the position of the URL which way to go.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: f1refly
The topic has been locked.
- f1refly
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
7 years 5 months ago #142203
by f1refly
Replied by f1refly on topic Is it possible to pass the token in the url and store as a hidden field?
Thanks for the reply. I thought I was being efficient by adding it to a post about the same thing but I certainly see what you mean!
I have managed to add the link (without the token) to the template because I do want it on every page. The TOKEN replacement variable doesn't work though. I'm not sure if it just doesn't work in the templates or if it is because my survey is anonymous. Could be both. I'll start a new thread about this.
Thanks again.
I have managed to add the link (without the token) to the template because I do want it on every page. The TOKEN replacement variable doesn't work though. I'm not sure if it just doesn't work in the templates or if it is because my survey is anonymous. Could be both. I'll start a new thread about this.
Thanks again.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
7 years 5 months ago #142225
by Mazi
This is to ensure anonymity.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Is it possible to pass the token in the url and store as a hidden field?
If the survey is anonymous, the TOKEN replacements will probably be turned off. Same for variables like {TOKEN:ATTRIBUTE_1} and similar.f1refly wrote: I'm not sure if it just doesn't work in the templates or if it is because my survey is anonymous. Could be both. I'll start a new thread about this.
This is to ensure anonymity.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: f1refly
The topic has been locked.