@steelersfan88Aug 05.2004 — #For example ...<script type="text/javascript">
var num_secs = 10; // number of seconds before submit. var elem = document.getElementById('tmr') // the id of the timer element var frm = "myForm" // name of form
window.onload = function() { document.getElementById('tmr').innerHTML = "You have "+ num_secs +" second"+ ((num_secs!=1) ? "s" : "" ) + " to submit the form."; frm = document.forms[frm] window.setInterval("sub('num_secs')",1000) }
function sub(val) { window[val]--; document.getElementById('tmr').innerHTML = "You have "+ num_secs +" second"+ ((num_secs!=1) ? "s" : "" ) + " to submit the form."; if(window[val] == 0) { document.getElementById('tmr').innerHTML = "Submitting ..."; frm.submit(); } }