Dynamic URL in Text Display question

More
3 years 7 months ago #100181 by lfortunato
lfortunato created the topic: Dynamic URL in Text Display question
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

Please Log in to join the conversation.

More
3 years 7 months ago #100198 by lfortunato
lfortunato replied the 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</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!!!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now