View Full Version : How do I cancel a form submit that is in progress?

08-30-2007, 05:21 PM
I have a form that uploads a file and pops up a progress meter (I use setInterval() to run the monitor process). In the meter, I'd like to have a cancel button. So let's say the file takes a whopping 10 minutes to upload and at about minute 5 the user decides to hit the cancel button and terminate the upload. How do I instruct the form to stop uploading the file, or is this not possible?


08-30-2007, 08:36 PM
Most browsers have a button on the toolbar for that. It is usually labelled "Stop" or is red with an X in it. There is no way to do it from JavaScript until after the next page has loaded sufficiently to load the code for that option by which time the upload will have finished.

08-30-2007, 09:17 PM
Well, in that case my question becomes, how can my progress meter (running via setInterval()) know that the user has hit the cancel (red x) on the browser toolbar? Because I'd hate to have the user hit that red x up there, and leave the progress meter (a dhtml dialog) up.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum