From: Jesse V. <je...@6t...> - 2003-12-29 03:47:01
|
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 |
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 |
From: Jesse V. <je...@6t...> - 2003-12-29 20:16:03
|
Boo...hiss..... That's what I was afraid of. Thanks anyway. Jesse Raymond Irving wrote: >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 > > > >------------------------------------------------------- >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 > > |
From: Andy S. <in...@re...> - 2003-12-29 20:47:28
|
well you could just inform MSIE users using the document.onbeforeunload = property (all msie's) which does return false, though this sort of = negates the whole X-browser thing regards sh0rtie <snip> |
From: Doug M. <do...@cr...> - 2003-12-29 23:58:26
|
It is possible in IE. Not in NS 4.x and unsure in Mozilla. In IE: <SCRIPT LANGUAGE=JavaScript FOR=window EVENT=onbeforeunload> var strMsg = 'Press Cancel if you wish to save your form before leaving\nIf you press OK you will lose all unsaved information.'; if (!top.ButtonClicked) { window.event.returnValue = strMsg; } </SCRIPT> ----- Original Message ----- From: "Jesse Vitrone" <je...@6t...> To: "dynapi help" <dyn...@li...> Sent: Sunday, December 28, 2003 10:50 PM Subject: [Dynapi-Help] dynapi.onUnload question > 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 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003 |
From: ToddNY <vze...@ve...> - 2004-01-01 22:30:03
|
Anyone write a PHP Soda server? Todd. |