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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem closing winodow after submit 1

Status
Not open for further replies.

mhamilton3

Programmer
Oct 31, 2001
129
Hello,
I have had this reoccurring problem that I have several solutions to, but none seem to work in all cases. I have instances where a parent opens a child. The child gathers some information and returns back to the parent. The problem I run into is with closing the child.

What I want to do is the following:

function callsubmitadd() {
document.addform.target = 'parentWindow';
document.addform.submit();
window.close();
}

That solution does not seem to work on the Mac (OS X with IE 5.2). The child at this point just hangs going back. Is there simple way to close an html form upon submit of a form? Thanks.


 
Code:
function callsubmitadd() {
  document.addform.target = 'parentWindow';
  document.addform.submit();
  self.close();
}

try this:

__________________________________________________________
"The only difference between me and a mad man is that I'm not mad."
- Dali
 
window.close() should work. Here's the code MSDN gives:
Code:
<SCRIPT LANGUAGE="JScript">
function foo() {
    close();}
</SCRIPT>
Nope, I didn't remove a carriage return. That's all MSDN :)
 
Thank you very much! Self.close() did the trick. All is right with the world. Window.close is supposed to work, but I find in some cases it does not. Now I have another option!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top