Hi!
I have a survey (Version 2.05+ Build 131209) with two question groups. In the first group there is 6 questions:
1x Equation Type
5x Text Display Type (in each one there is a link to open a popup window)
The Principe is to randomise the show one of the 5 Display text question versions to the users.
So I structured the group as follows:
- In the Equation – Question Type (Code= randnr):
Code:
If (randnr >= 1, randnr, (rand(1, 5)))
- And in the five Text Display – Questions type:
Code:
<p>Please click on the following link to see the Gallery</p>
<h3 style="color: red; text-align: center;">
<span style="font-size:28px;">
<a href="https://mylink.com/gallery_1" onclick="window.open(this.href, '', 'resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=1024,height=800'); return false;">► GALLERY ◄</a></span></h3>
And in the appropriate relevance was : (randnr.NAOK == "1"))
and for the second question : (randnr.NAOK == "2"))
etc. ….
Until now the randomizing
works perfectly!
But I want that the
PopUp window to close after 9 seconds, so I tried to change the Text Display Question and add a JScript code as follows:
Code:
<script type="text/javascript" language="JavaScript">
function openwindow() {
win = window.open("https://mylink.com/gallery_1","my_new_window","width=1024,height=800,top=0,left=0");
window.setTimeout("win.close()", 9000);
}
</script>
<p>Please click on the following link to see the Gallery</p>
<h3 style="color: red; text-align: center;">
<span style="font-size:28px;">
<a href="#" onclick="javascript:openwindow();">► GALLERY ◄</a></span></h3>
And the appropriate relevance wasn’t changed.
After the changes the randomizing
no longer works correctly.
Did I do something wrong? Did call the survey the rand()-function twice?
Thanks for the Help.
Yasmina.