This topic is locked

Countdown autosubmit

9/4/2012 1:29:21 PM
PHPRunner General questions
S
Sun author

Hi, using http://keith-wood.name/countdown.html script is it possible to submit quiz or save in a add new page to submit automatically after the count done is over, any working examples available for phprunner?

sun

S
Sun author 9/5/2012



Hi, using http://keith-wood.name/countdown.html script is it possible to submit quiz or save in a add new page to submit automatically after the count done is over, any working examples available for phprunner?

sun


I have come upto here

<SPAN style="DISPLAY: none" class=buttonborder><INPUT id=submit2 class=button value="New value" type=button name=submit2></SPAN>
$("#submit2").bind("click", {page: this}, function(e){

var page = e.data.page;

page.saveHn(e);

});

window.setTimeout("document.getElementById('submit2').click()", 20000);


But I would like to use a database value for the timeout function ( instead of direct value like 20000 in above script) and same to be dispalyed as a countdown in the page! any help is appreciated!

sun

Sergey Kornilov admin 9/6/2012

If you use PHP code snippet to insert this sort of code - you can retrieve timeout value from the database and plug it in there.

// retrieve timeout value from the database

$timeout=...;
echo '<SPAN style="DISPLAY: none" class=buttonborder><INPUT id=submit2 class=button value="New value" type=button name=submit2></SPAN>
$("#submit2").bind("click", {page: this}, function(e){

var page = e.data.page;

page.saveHn(e);

});

window.setTimeout("document.getElementById(\'submit2\').click()", ' . $timeout . ');'