Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: window.location on a button not working?

window.location on a button not working? 4 years 4 months ago #83446

  • Melarish
  • Melarish's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
I'm trying to add buttons at the end of the survey to redirect the user to one of two pages. However, both of them redirect to /limesurvey/index.php for some reason. Am I doing something wrong?
<button onclick="window.location='http://www.musicquotient.com'">No, thanks</button>
The administrator has disabled public write access.

window.location on a button not working? 4 years 4 months ago #83451

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 467
  • Karma: 118
Strange... it should work!
Try an alternative way like:
<a href="http://www.musicquotient.com"><button>No, thanks</button></a>
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 4 years 4 months ago by Ben_V.
The administrator has disabled public write access.

window.location on a button not working? 4 years 4 months ago #83484

  • Melarish
  • Melarish's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Still the same result - goes to index.php :(

Is there any setting anywhere that could prevent external links? I checked general settings but nothing like that there.
Last Edit: 4 years 4 months ago by Melarish.
The administrator has disabled public write access.

window.location on a button not working? 4 years 4 months ago #83486

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 467
  • Karma: 118
a bit tricky.. I've never seen this kind of issue :(
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.
Time to create page: 0.372 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form