- Posts: 38
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
No token in URL after submission is rejected
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
More
4 years 7 months ago #188153
by LarryMartell
No token in URL after submission is rejected was created by LarryMartell
If I bring up a survey the token is in the URL. If I then submit the survey, but have not answered all the mandatory questions the survey is properly rejected. But when the page is redrawn the token is not in the URL. Is that a bug or is it expected? I need the token in some custom JS code I have.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
4 years 7 months ago #188156
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic No token in URL after submission is rejected
The URL is not carrying any parameter during the survey. It's a cookie session.
You already have that thread here.
www.limesurvey.org/forum/installation-a-...oken-from-javascript
You already have that thread here.
www.limesurvey.org/forum/installation-a-...oken-from-javascript
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
4 years 7 months ago #188158
by LarryMartell
Replied by LarryMartell on topic No token in URL after submission is rejected
Yes, that thread was about getting the token, which I am doing - I get it from the URL. But now when it's not in the URL I cannot get it.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
4 years 7 months ago #188159
by jelo
In that thread you wrote:
And Tpartner answered:
You still can open a bug report.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic No token in URL after submission is rejected
Which only works on the first screen.LarryMartell wrote: Yes, that thread was about getting the token, which I am doing - I get it from the URL.
In that thread you wrote:
Ah, the token is in the URL and I can get that in the JS.
And Tpartner answered:
That will probably only work on the first screen or if using AJAX mode (which I advise against).
You still can open a bug report.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 7 months ago #188168
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic No token in URL after submission is rejected
It's the needed behaviour …
To get the token in a script
in custom_header.twig for template or in question text (or anything else).
Then you can use it in any script …
To get the token in a script
Code:
<script> var userToken = '{TOKEN}' </script>
Then you can use it in any script …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
4 years 7 months ago #188174
by LarryMartell
Replied by LarryMartell on topic No token in URL after submission is rejected
That was the first thing I had tried. It is not defined. Placeholders are not available in the custom.js file
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
4 years 7 months ago - 4 years 7 months ago #188178
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 No token in URL after submission is rejected
I agree with Denis. I don't think it's a bug but is expected behaviour.
As long as the survey is not anonymous, the {TOKEN} placeholder will be available in scripts in question text, group description text or in some theme twig files.
As long as the survey is not anonymous, the {TOKEN} placeholder will be available in scripts in question text, group description text or in some theme twig files.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 7 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 7 months ago #188188
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic No token in URL after submission is rejected
Can you read again my comment ?LarryMartell wrote: That was the first thing I had tried. It is not defined. Placeholders are not available in the custom.js file
in custom_header.twig for template or in question text (or anything else).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
4 years 7 months ago #188192
by LarryMartell
Replied by LarryMartell on topic No token in URL after submission is rejected
Where would I find the custom_header.twig file?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
4 years 7 months ago #188197
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 No token in URL after submission is rejected
Please refer to the manual -
manual.limesurvey.org/New_Template_System_in_LS3.x
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- LarryMartell
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
4 years 7 months ago #188199
by LarryMartell
Replied by LarryMartell on topic No token in URL after submission is rejected
We are running 2.73.1
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 7 months ago #188204
by DenisChenu
Maybe best is to tell us at start …
head tag is in startpage.pstpl
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic No token in URL after submission is rejected
…LarryMartell wrote: We are running 2.73.1
Maybe best is to tell us at start …
head tag is in startpage.pstpl
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.