first of all i dont know whether to post here or i the php code section as it concerns both.
I got a basic Timer in Javascript
Code: Select all
<html>
<head>
<script type="text/javascript">
var c=10;
var t;
var timer_is_on=0;
function timedCount()
{
if (c>0)
{
document.getElementById('txt').value=c;
c=c-1;
t=setTimeout("timedCount()",1000);
}
else
{
document.getElementById('txt').value=c;
stopCount();
}
}
function doTimer()
{
if (timer_is_on=1)
{
timedCount();
}
}
function stopCount()
{
timer_is_on=0;
}
</script>
</head>
<body>
<form>
<input type="button" value="Start count!" onclick="doTimer()" />
<input type="text" id="txt" />
</form>
</body>
</html>
so that i pass the variable when the function stopCount() is activated it will make a variable that i can send to php.
//Thanks in advance
//Thomas