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
changed.

Any help is appreciated!

IV**@tda.no
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


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


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

function checkchanged(){
if(top.contentframe.changed){
return confirm(
'You have unsaved changes that will be lost!\n'+
'Do you want to continue anyway?'
);
}
}

Richard.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.