JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2058
Number of posts: 5158

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
unload event handling Posted by weirdmix on 31 Mar 2005 at 11:41 AM
hello all:
I'm having a problem, I'm opening an asp web page using javascript window.open method. The thing is, in the window opened I need to prevent that the user close the window without typing any information required. I mean, I know that I have to check if the user type something in fields in the UNLOAD event of the body tag, but how can I stop the window from closing if the checks are false?
I hope someone can help me.
thanks in advance.

Report
Re: unload event handling Posted by Weirdofreak on 1 Apr 2005 at 8:17 AM
The only possible way would be to use return false, but if that works there's a big problem with the browser. Imagine how easy it would be to have a page which doesn't let you leave. Besides, you can never rely on a Javascript being run. You'll need some server-side checks to see if the form is empty, instead.
^D
$ shameless-plug
http://line-ed.sourceforge.net




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.