Forum Moderators: open

Message Too Old, No Replies

Best Way To Close A Page

...and do it neatly!

         

austtr

11:12 pm on Jan 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most form-to-email scripts include an option to redirect to a thanks page after clicking the submit button. I prefer to have the thanks page open in a new window.

I'd like to have a simple "close page" button on the bottom that just simply closes the page....period. I'd prefer not to just link to another page.

What is the best way to do that? The javascript window.close() only works if the page was opened by a javascript which is not the case.

Suggestions appreciated.

MWpro

11:21 pm on Jan 12, 2003 (gmt 0)

10+ Year Member



What are you using to make it go from the form to email, php? And is your problem just getting the window to close with the link/button or having the window pop up and also having the close window link?

Key_Master

11:25 pm on Jan 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following works well for me.

<a href="javascript:close();">Close Window</a>

MWpro

11:28 pm on Jan 12, 2003 (gmt 0)

10+ Year Member



>><a href="javascript:close();">Close Window</a>

On some browsers when you use that script, it pops up a message asking them if they want to close the window... personally, I think this is more frustrating than just clicking the X and don't recommend it.

Why not use a script that will just close the window after a few seconds on it's own?