Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Dynamic URL in Text Display question

  • lfortunato
  • lfortunato's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 5 months ago #100181 by lfortunato
Dynamic URL in Text Display question was created by lfortunato
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 topic has been locked.
  • lfortunato
  • lfortunato's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 5 months ago #100198 by lfortunato
Replied by lfortunato on topic Dynamic URL in Text Display question
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
<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 topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose