are you asking for an alert message? If so, javascript is always:
onclick="return confirm ('Message to confirm');"
If you want an advanced one, like when the user clicks no or yes, a new alert box will appear saying that the changes were successful or aborted, then follow the article below:
http://aspnet.4guysfromrolla.com/articles/021104-1.aspx
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
You will need to set an onchange or onkeydown event in all of your editable controls to set a global dirty flag. Check this flag in the window.onbeforeunload event and simply return a string to it, the browser will do the rest.
<html>
<head>
<script type="text/javascript">
var unsaved = false;
window.onbeforeunload = function(){if(unsaved){return "You have unsaved data. Are you sure you wish to leave this page.";}};
</script>
</head>
<body>
<input type="text" id="txt1" onkeydown="unsaved = true;"/>
</body>
</html>
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68