That's what the "intentionallyLeavingPage" variable was in my code snippet. 
Submit buttons set this JS variable, so the check is bypassed in that case.

-Ross

On Feb 2, 2010, at 3:32 PM, Naftoli Gugenheim wrote:

> One problem -- this script should not be triggered by submit buttons or 
> stateful links!
> 
> -------------------------------------
> Timothy Perrett<timo...@getintheloop.eu> wrote:
> 
> Try:
> 
>      window.onbeforeunload = function(evt){
>        var reply= "You have unsaved changes!";
>        if(typeof evt == 'undefined'){
>          evt = window.event;
>        }
>        if(evt){
>          evt.returnValue = reply;
>        }
>        return reply;
>      }
> 
> Cheers, Tim
> 
> 
> On 2 Feb 2010, at 18:31, Naftoli Gugenheim wrote:
> 
>> Hi, in Lift how would one implement functionality similar to in Gmail, that 
>> when you try to navigate away from an unsaved email you get a dialog box 
>> asking to confirm?
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/liftweb?hl=en.
>> 
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to