You might want to try adding an observer to all form elements to detect when
the values change. For example:
var isDirty = false;
$$('input, textarea').invoke('observe', 'change', function()
{
    isDirty = true;
});

-Hector


On Fri, Mar 27, 2009 at 3:22 PM, Stefano Esposito <
stefano.esposit...@gmail.com> wrote:

>
> On Fri, 27 Mar 2009 16:55:58 -0500
> "Russell Keith" <russell.ke...@aacreditunion.org> wrote:
>
> > I have an iframe and I am using the onbeforeunload to prevent data
> > loss. What I need to do is set a variable called save to 0 after any
> > change is made within the frame.
> >
> >
> >
> > I tried this but it doesn't work:
> >
> >
> >
> >             document.observe('change', function(){
> >
> >                         save=0
> >
> >             });
> >
> >
> >
> > How can I accomplish this task?  Is it possible to observe for any
> > change made?
> >
>
> I'm not sure of this, nor I've tested, but I'd try to observe
> keypress events.
>
> Ciao,
> Stefano
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to