Timed survey Submit

More
6 months 1 week 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

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
6 months 1 week ago #176554 by jelo
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

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #176555 by chukoo
Replied by chukoo on topic Timed survey Submit
Version 3.15.1+181017

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #176557 by DenisChenu
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();

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks 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>

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago #177486 by DenisChenu
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

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks 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.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!