Results 1 to 3 of 3

Thread: Save the user's work

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Thumbs up 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>

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Where would such code be used?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    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
  •  



Click Here to Expand Forum to Full Width