- Posts: 166
- Thank you received: 26
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Issue with a redirect from within a survey
- davebostockgmail
- Topic Author
- Offline
- Elite Member
Less
More
5 years 2 weeks ago - 5 years 2 weeks ago #183230
by davebostockgmail
Issue with a redirect from within a survey was created by davebostockgmail
Good afternoon,
Well we finally bit the bullet and upgraded to version 3.17.0 +190402 and having resolved almost all my issues I have one outstanding that I was hoping that some one could help out on ...
It is a redirect to a different page when the next button is pressed in a question..
Here is the script
$(document).ready(function() {
var idnum={TOKEN:TOKEN};
var url='https://newpage.php?token='+idnum;
$('#ls-button-submit').bind('click', function () {
$(location).attr("href", url);
return false;
});
});
</script>
In debug it says there is an error in the JQuery where whatever the token is is unidentified so if the token was "Bob" it says Bob unidentified ... now this used to work in the older version (2.xx)
Can anyone see where this is going wrong?
Thanks for you help in advance
Dave
Well we finally bit the bullet and upgraded to version 3.17.0 +190402 and having resolved almost all my issues I have one outstanding that I was hoping that some one could help out on ...
It is a redirect to a different page when the next button is pressed in a question..
Here is the script
$(document).ready(function() {
var idnum={TOKEN:TOKEN};
var url='https://newpage.php?token='+idnum;
$('#ls-button-submit').bind('click', function () {
$(location).attr("href", url);
return false;
});
});
</script>
In debug it says there is an error in the JQuery where whatever the token is is unidentified so if the token was "Bob" it says Bob unidentified ... now this used to work in the older version (2.xx)
Can anyone see where this is going wrong?
Thanks for you help in advance
Dave
Last edit: 5 years 2 weeks ago by davebostockgmail. Reason: incorrect code
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
5 years 2 weeks ago #183233
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 Issue with a redirect from within a survey
Try placing {TOKEN:TOKEN} in the question text to see what is returned.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- davebostockgmail
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 166
- Thank you received: 26
5 years 1 week ago #183364
by davebostockgmail
Replied by davebostockgmail on topic Issue with a redirect from within a survey
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13645
- Thank you received: 2491
5 years 1 week ago #183369
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 Issue with a redirect from within a survey
var idnum="{TOKEN:TOKEN}";
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 following user(s) said Thank You: davebostockgmail
The topic has been locked.
- davebostockgmail
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 166
- Thank you received: 26
5 years 1 week ago #183371
by davebostockgmail
Replied by davebostockgmail on topic Issue with a redirect from within a survey
Thank you Denis ... works like a charm
The topic has been locked.