Welcome, Guest
Username: Password: Remember me

TOPIC: Dynamic URL in Text Display question

Dynamic URL in Text Display question 10 months 5 days ago #100181

  • lfortunato
  • lfortunato's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 38
  • Thank you received: 1
  • Karma: 1
Hi everyone!

In the same LimeSurvey installation (version 1.92) I have two surveys:
SURVEY1 (SID = 001) and SURVEY2 (SID = 002).

I need to put in SURVEY1 a pointer to SURVEY2, but I need a dynamic URL, not carved.

So I put in SURVEY1 a question (with question type "Text Display") and placed a link
like this in source:

<a href="{$_SERVER}/index.php?sid=002" target="X">SURVEY2</ a>

But it does not solve the fragment {$_SERVER }

Could anyone kindly help me?

I posted this topic also in the italian LS forum

Thank you, Loredana
The administrator has disabled public write access.

Dynamic URL in Text Display question 10 months 5 days ago #100198

  • lfortunato
  • lfortunato's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 38
  • Thank you received: 1
  • Karma: 1
Thank you to lfanfoni, he gave me a solution on the italian forum...and it works!
:)

Here is the script, I put it into a Text Display question (source):

<a href="www.miosito.it" id="url1" target="_blank">SURVEY2</a>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
document.getElementById("url1").href="http://"+location.hostname+"/index.php?sid=002";
});
</script>

Thank you again!!!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.108 seconds
Donation Image