- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Timed survey Submit
- chukoo
- Topic Author
- Offline
- New Member
Less
More
5 years 5 months ago #176545
by chukoo
Timed survey Submit was created by chukoo
Hello
I'm trying to accomplish the timed survey and to auto submit the survey at the end of timer.
Thanks to the community I got so far up until the timer shows up on the page. Using the " www.limesurvey.org/forum/can-i-do-this-w...6-time-based-surveys "
I used below counter on my page:
<form name="counter">
<div style="width:400px;margin:auto;color:orange;">
span style="valign:middle">Time remaining : </span>
<input type="text" id="surveycounter" size="8" name="d2" class="counter" disabled="disabled">
</div>
</form>
How do I make it to go to submit button, when the time reached 00:00.$('#limesurvey').submit()
thanks
I'm trying to accomplish the timed survey and to auto submit the survey at the end of timer.
Thanks to the community I got so far up until the timer shows up on the page. Using the " www.limesurvey.org/forum/can-i-do-this-w...6-time-based-surveys "
I used below counter on my page:
<form name="counter">
<div style="width:400px;margin:auto;color:orange;">
span style="valign:middle">Time remaining : </span>
<input type="text" id="surveycounter" size="8" name="d2" class="counter" disabled="disabled">
</div>
</form>
How do I make it to go to submit button, when the time reached 00:00.$('#limesurvey').submit()
thanks
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 5 months ago #176554
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Timed survey Submit
You should post the LimeSurvey version you use.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- chukoo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 5 months ago #176555
by chukoo
Replied by chukoo on topic Timed survey Submit
Version 3.15.1+181017
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 5 months ago #176557
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Timed survey Submit
manual.limesurvey.org/Question_type_-_Short_free_text#Timer
and its done …
Else if you want to do your js : deactivate ajax mode it broke $('#limesurvey').submit();
Else if you want to do your js : deactivate ajax mode it broke $('#limesurvey').submit();
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- chukoo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 4 months ago #177481
by chukoo
Replied by chukoo on topic Timed survey Submit
Hello Denis, Thanks for the suggestion.
I have below on my layout_global.twig at the bottom, the timer works, however when the timer reaches 0 it doesn't submit. Could you please tell me where I'm wrong in this? thanks in advance
function display() {
if (seconds <= 0 )
{
seconds = 60;
minutes -= 1;
}
if(minutes <= -1)
{
seconds = 0;
minutes = 0;
}
else
seconds -= 1;
document.getElementById("surveycounter").value = minutes + " : " + seconds;
document.cookie="infinit_minutes=" + minutes;
document.cookie="infinit_sec=" + seconds;
if(seconds == 0 && minutes == 0)
{
}
else {
setTimeout("display()",1000)
}
}
{
if(seconds == 0 && minutes == 0)
document.getElementById('#limesurvey').submit();
}
</script>
<body onload="display()">
<form name="counter">
<div style="width:400px;margin:auto;color:orange;">
<span style="valign:middle">Time remaining : </span>
<input type="text" id="surveycounter" size="8" name="d2" value="1" class="counter" disabled="disabled">
</div>
</form>
</body>
</html>
I have below on my layout_global.twig at the bottom, the timer works, however when the timer reaches 0 it doesn't submit. Could you please tell me where I'm wrong in this? thanks in advance
function display() {
if (seconds <= 0 )
{
seconds = 60;
minutes -= 1;
}
if(minutes <= -1)
{
seconds = 0;
minutes = 0;
}
else
seconds -= 1;
document.getElementById("surveycounter").value = minutes + " : " + seconds;
document.cookie="infinit_minutes=" + minutes;
document.cookie="infinit_sec=" + seconds;
if(seconds == 0 && minutes == 0)
{
}
else {
setTimeout("display()",1000)
}
}
{
if(seconds == 0 && minutes == 0)
document.getElementById('#limesurvey').submit();
}
</script>
<body onload="display()">
<form name="counter">
<div style="width:400px;margin:auto;color:orange;">
<span style="valign:middle">Time remaining : </span>
<input type="text" id="surveycounter" size="8" name="d2" value="1" class="counter" disabled="disabled">
</div>
</form>
</body>
</html>
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 4 months ago #177486
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Timed survey Submit
<body onload="display()"> : what the fuck is this body ????
Please : use jquery : api.jquery.com/ready/
And if(seconds <= 0 && minutes <= 0) surely too
Please : use jquery : api.jquery.com/ready/
And if(seconds <= 0 && minutes <= 0) surely too
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- chukoo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 4 months ago #177727
by chukoo
Replied by chukoo on topic Timed survey Submit
Thanks Denis for your Suggestion.
I was able to do this with jquery.
I was able to do this with jquery.
The topic has been locked.