if (seconds<=-1){
alert('Time up!');
}
else {
milisec-=1
setTimeout("display()",100)
}
document.counter.d2.value=seconds+"."+milisec
You have to put the setTimeout inside the else
I'm not sure what you are trying to do in the second part.
But if you want to start it only when the user click on a button remove the line
display()
and on your button (or link) add a onClick="display(); return false;" like so
<input type="button" onClick="display(); return false;" value="Click Me!" />
And to update data, you will need to return to the server side.
So at the end of the count down, you could either do a redirect with the data you want as parameter
window.location = "http://www.test.com?user=1&stats=4&..."
Or you could use ajax to send data to the server without reloading the page. But this could be a little more complex, if you want ajax, I suggest to use some javascript library such as jquery or prototypejs