unfortunately we had already tried this. Though it works, we want to replace some of the text in the message with our own message.
Main Topics
Browse All TopicsWe have a bound data control on a web page. If the data in this control has changed and the user inadvertantly starts to navigate away from the page (Refreshes, Closes IE4, hits Hyper Link...) we want to prompt the user to save their data. Currently we can use the window.event.returnvalue within the Window_OnBeforeUnload event to stop the navigation. Unfortunately, this throws up a dialog box that simply asks the user to cancel the navigation. We don't want to ask them to cancel the navigation, we only want to ask them if they want to save and if they click yes then the navigation should automatically be canceled. We can't overwrite the "Cancel Navigation" prompt - does anyone know how we might accomplish this?? Below is the work around we are currently displaying to the user. We only want to prompt them for saving.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
featured on Webreference.com http://www.webreference.co
seems they don't feature any custom message except what's put in between the two standard messages.
upon first reading your question I tested it a bit with IE, and you can always throw an alert() or something, but in the end IE will _always_ show the standard OK/Cancel dialog. or at least that's what it seemed like to me. you can't return prematurely from the function to cancel that dialog, and if you try to use any return value it'll be used for the dialog. so it seems that IE first calls the function set to take care of unbeforeunload and when that function has returned throws up the OK/Cancel dialog. this will, of course, leave us unable to customize it. :(
Business Accounts
Answer for Membership
by: nettromPosted on 1999-04-16 at 05:13:35ID: 1861454
I've been unable to create a kind of 'yes/no' dialog for the user when the onbeforeUnload()-event fires, but you can insert your desired message into the dialog by giving the event a return-value of your choice. e.g:
workshop/a uthor/dhtm l/referenc e/ events/o nbeforeunl oad.asp#on beforeunlo ad
event.returnValue = "We'd like to remind you that you should save your work before leaving. Click 'Cancel' to go back and save. Click 'OK' if you've saved your work and are ready to go on";
the user will then get this message, and the OK/Cancel-information is giving him/her the correct instructions so that he can cancel the navigation and go back and save.
for more information try http://msdn.microsoft.com/