The onUnload event doesn't bubble, which means that you can't abort the operation of 
the page using onUnload.

IE has an event called onBeforeUnload that does what you need, but it always displays 
a confirmation box, and you can only add text to the box - there's fixed text on it 
that's always displayed.

----- Original Message -----
From: "David Collie (itndac)" <[EMAIL PROTECTED]>
Date: Monday, February 24, 2003 8:23 am
Subject: RE: OT - JS Question

> <script>
> var bChangeFlag = False;
> 
> function udfFlagChange() {
>       bChangeFlag = True;
> }
> 
> function udfCheckChange() {
>       if (bChangeFlag == True) {
>               alert('You changed somethings');
>               return false;
>       } else {
>               return true;
>       }
> }
> </script>
> 
> <body onUnload="udfCheckChange()">
> 
> Every input element would have onChange="udfFlagChange()" 
> attribute added to it....
> 
> Above is very hacked and don't know if the returning false from 
> the onUnload will work in not letting them move on the page... 
> also in my experience, onChange doesn't work too well either
> 
> onUnload doesn't work very well anyways
> 
> dc
> 
> -----Original Message-----
> From: Tangorre, Michael [mailto:[EMAIL PROTECTED]
> Sent: 24 February 2003 15:11
> To: CF-Talk
> Subject: OT - JS Question
> 
> 
> Hey everyone, sorry for the OT post, but I figure someone might 
> have a solution to my problem.
> 
> I need a way to alert the user that they have made changes to one 
> or more form fields if they attempt to exit the page before saving.
> 
> does anyone know of a quick solution to this?
> 
> Thanks,
> 
> Mke
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to