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

automatically close one pop up window when another opens

Status
Not open for further replies.

monstermash

Technical User
Aug 15, 2000
18
0
0
US
Hello,

I have 1 html page with many buttons that open pop-up windows. Is there a way in the javascript code to automatically make whatever pop-up window is open, close, when another button is clicked? Thank you.
 
Yes, I beleive. If you define the window as one name for all of them, calling them something like "popup" for all the windows, then you insert a close command:
<.... onClick=&quot;popup.close();&quot;>
Then open a new window with the same name, &quot;popup&quot;. do this for all of them and each button will close the window before opening a new one. The only thing I think might not work is that if you have it on the same line or command or whatever it's called (I forget easily), it might not open up a window with the same name, but try it out. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top