I have a javascript that refreshes my page every 45 seconds. I want to disable the page refresh if the user is filling a form on the page.
Otherwise in IE i lose all data. I want the user to be able to enable the javascript again. Is this possible?
A button that could be clicked to disable the refresh and then enable it again.
Here is my javascript code
Otherwise in IE i lose all data. I want the user to be able to enable the javascript again. Is this possible?
A button that could be clicked to disable the refresh and then enable it again.
Here is my javascript code
Code:
<script>
<!--
//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:45"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}
window.onload=beginrefresh
</script>