By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

Howto: Alert user when leaving a frame

P: n/a
I have a frameset where one frame contains a menu and the other the screens
where the contents change depending on what the user clicks in the menu.

Is there any relatively easy way to give the user a warning that changes
should be saved and will be lost unless doing so when she or he clicks an
option in the menu. This should of course only happen if something is

Any help is appreciated!

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Kevin Thorpe" <ke***> wrote in message
news:3f*********************** ..
menu page:
<script language="javascript">
function checkchanged() {
if (top.contentframe.changed) {
alert('Please save your changes first');
return false;
} else {
return true;

This would prevent navigation following any changes but suppose the
changes were a mistake and should not be saved.

function checkchanged(){
return confirm(
'You have unsaved changes that will be lost!\n'+
'Do you want to continue anyway?'

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.