Click to See Complete Forum and Search --> : Open/Close "progress" pop-up window during form submit
I'm trying to implement a pop-up window that basically informs the user that the system is working while processing a request. The pop-up is launched from the main window immediately after a form is submitted from the main window, then closes automatically as soon as the main window is finished processing. I'm not trying to post anything to the child pop-up window; navigation continues on the main window. The pop-up window is just a basic HTML page with an animated GIF of an hour glass that represents processing. I'm having trouble getting this to work. Does anyone have have some sample code? Thanks!
SAFX
Charles
02-17-2003, 12:29 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<form action="test2.html" onsubmit="win = window.open('http://www.w3.org'); window.onunload = function () {if (!win.closed) win.close()}">
<div><input type="submit"></div>
</form>
Thanks Charles, but I tried exactly what you posted and it doesn't work. I'm using Windows XP and IE 6. Any suggestions?
Thanks again,
SAFX
Charles
02-17-2003, 01:03 PM
Post a url to your page. That piece of script worked just fine when I tested it. Be advised, though. I'm currently taking a break from digging my house out from under two feet of snow and will be heading back outside soon. (And I live in the South, yet.) Please don't expect a reply right away.
Yeah, I know how you feel about the snow, I'm on Long Island in New York. We got almost 2 feet!
Anyway, here is my form before I added your code:
<form name="newEvaluation" action="" method="POST" enctype="multipart/form-data">
..and I'm submitting my form via a function...
function newEval(){
document.newEvaluation.action = "/CCA/newEval";
document.newEvaluation.submit();
}
..and after adding your code appropriately in my form decleration...
form name="newEvaluation" action="" method="POST" enctype="multipart/form-data" onsubmit="win = window.open('http://www.w3.org'); window.onunload = function () {if (!win.closed) win.close()}">
..it doesn't seem to work in the context of my application, but your code certainly works by itself, I agree. There must be something else wrong. Should I move some of your code to, perhaps, a function, since I'm using a function for my submit?
Thanks again,
SAFX
Thanks, Charles, I moved some of the code around and placed the window.onunload outside of the form decleration and it works great! Thanks for the help!
SAFX