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

Open a new window and close an existing window simultaneously?

Status
Not open for further replies.

sgore

Programmer
Jul 22, 2001
30
CA
When I submit a form is there a way to close the existing window and open a new window at the same time?

close window
<form method=&quot;post&quot;>
<input type=&quot;button&quot; value=&quot;Close Window&quot;
onclick=&quot;window.close()&quot;>
</form>

open window
<form>
<input type=&quot;button&quot; value=&quot;Open Window&quot;
onclick=&quot;window.open('yourfile.htm')&quot;>
</form>

Is there a way to do this together? open a new window and close an existing window simultaneously?
 
How about:
Code:
<input type=&quot;button&quot; value=&quot;Open/Close Window&quot; 
onclick=&quot;javascript:window.open('yourfile.htm');window.close();&quot;>
Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top