|
-
Dec 30th, 2002, 09:40 AM
#1
Thread Starter
PowerPoster
Save the user's work
Code:
<SCRIPT LANGUAGE=javascript>
<!--
//The purpose of this code is to save the user's work when they
//have been inactive for more than one hour and forty-five minutes.
var minutes = 60
var TimeOut = ((105 * minutes) * 1000)
//Saves the user's work
function SaveUsersInfo(){
alert("subbed")
document.form.submit()
}
//This is the timer
self.setTimeout('SaveUsersInfo()', TimeOut)
//Variables to capture events
var IE4 = (document.all)
var NS4 = (document.layers)
if (NS4) document.captureEvents(Event.KEYPRESS)
//Capture keyboard and mouse click events
document.onkeypress = ClearTimer
document.onclick = ClearTimer
//Resets the timer after every keyboard or mouse click event
function ClearTimer(){
self.clearTimeout('SaveUsersInfo()')
self.setTimeout('SaveUsersInfo()', TimeOut)
//alert(TimeOut)
}
//-->
</SCRIPT>
-
Dec 30th, 2002, 01:00 PM
#2
Where would such code be used?
-
Dec 31st, 2002, 03:17 PM
#3
Thread Starter
PowerPoster
Originally posted by mendhak
Where would such code be used?
In a data entry web application.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|