From: Raymond I. <xw...@ya...> - 2003-12-29 16:01:42
|
Problem: onUnload can't return false to stop the location change like onSubmit can do. Workaround: Check if the page should be unloaded in onClick in all links and in onSubmit in all forms. It's not elegant, but it works. Code Example: We have a function check(), returning true if the page should be unloaded, false otherwise. A link: <a href="p.html" onClick="return( check() );"> A form: <form action="p.pl" onSubmit="return( check() );"> --- Jesse Vitrone <je...@6t...> wrote: > I have a page where the user is moving some layers > around, and I want to > make sure they save before they leave the page, so > I'd like to promt > them with a warning if the page is unloading and > they haven't saved. > > To do that, I need to stop the page from unloading > if they want to > save. What can I do with dynapi.onUnload to stop > the page from > unloading? Is it possible? > > Thanks in advance, > Jesse Vitrone > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux > Tutorials. > Become an expert in LINUX or just sharpen your > skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the > bash shell to sys admin. > Click now! > http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help |