Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close "...Wait" Window 1

Status
Not open for further replies.

nat1967

Technical User
Feb 13, 2001
287
US
Hi everyone,

on my form, i allow the users to upload a file to my server. since i do not have a "status" bar telling the user how long it is going to take to upload, i thought i would pop a temp window and ask them to "please wait while file is uploaded".

after the file is uploaded, I want to close the "pop" window. i have read and read throughout this and other websites and cant seem to get anything to work. i tinker with JavaScript at best.

here is my form line that calls the "pop":

<form action=&quot;ordersubmit.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; onSubmit=&quot;MM_openBrWindow('pleasewait.html','pleasewait1','width=300,height=250')&quot;>


This works fine. The file uploads and the &quot;pop&quot; does appear. However, i can not seem to close the &quot;pop&quot;. I am sure its my inexperience.

in the main window's UnLoad event, I placed:

< body onUnload=&quot;window.close('pleasewait1')&quot;

this had no affect. the window just smiled at me. :-(

i have also tried:

onUnload=&quot;pleasewait1.close()&quot;

Can someone help show me what I am doing wrong?



Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
try

<form action=&quot;ordersubmit.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; onSubmit=&quot;oWait = MM_openBrWindow('pleasewait.html','pleasewait1','width=300,height=250')&quot;>

and
<body onunload=&quot;try{oWait.close();}catch(E){};&quot;>




=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Hi Jeff,

Thanks for responding but it didnt work. :-(

here is what i put in:

<body onunload=&quot;try{oWait.close();}catch(E){};&quot;>

<form action=&quot;ordersubmit.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; onSubmit=&quot;oWait = MM_openBrWindow('pleasewait.html','pleasewait','width=300,height=250')&quot;>


the 'ol &quot;pop&quot; window just laughed again at me. :-(

i wasnt sure about the &quot;try&quot; in the onunload event so i tried:

<body onunload=&quot;{oWait.close();}catch(E)();&quot;>

didnt work either....

any other thoughts?

Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
ok, same thing but add &quot;window.&quot; :

<body onunload=&quot;try{window.oWait.close();}catch(E){};&quot;>

<form action=&quot;ordersubmit.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; onSubmit=&quot;window.oWait = MM_openBrWindow('pleasewait.html','pleasewait','width=300,height=250')&quot;>

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Hi jeff,

i cut/pasted exactly what you have and the &quot;pop&quot; window didnt close. :-(

any other thoughts?



Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
hi jeff,

i am not using frames. i'll be damned if i know what is happening. it makes no sense to me but since you got it to work, its obviously on my end. i will continue to play with it and try to figure it out.

thanks for all your help and sharing your knowledge.

Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
hi jeff,

i have broken it down to just trying to figure this out without a lot of variables. here is what i have:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body onunload=&quot;try{window.oWait.close();}catch(E){};&quot;>

<a href=&quot;orderform.html&quot; onClick=&quot;window.oWait = MM_openBrWindow('pleasewait.html','scrubs','')&quot;>click
here</a>

</body>
</html>


it doesnt work either. can you see what i am doing wrong? i just dont get it.... :-(



Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
aha...because you're calling another function that actually calls window.open() and does not return a reference. this fixes it:

function MM_openBrWindow(theURL,winName,features) { //v2.0
return window.open(theURL,winName,features);
}

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Hi Jeff,

WHOOHOO!!!! That did it!!!!! There are not enough STARS in the forum to say thanks!!

Thanks for hanging with me and your patience.



Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top