473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Howto: Alert user when leaving a frame

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
1 2230
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Google Mike | last post by:
Had to write something similar to this for my office. You can adapt to your use. I just put it on a chron job for every 15 minutes. My bash script did: #!/bin/bash php -d...
3
by: PVU | last post by:
Hello, I have an page that calls the function below. What i want to do is that this function post data to the server (ASP) and the server will response with 'OK' My question is how can i send...
17
by: KS | last post by:
I got 2 inputs in a form where I want check if start > end. Seems like it just compare the first number when I got this code in javascript "if(document.all.start > document.all.end)" How do i...
9
by: Targa | last post by:
Ive seen alert scripts triggered by links but I need one that will cover any link or pressing the back/forward buttons. Any such thing? TIA
8
by: Zvonko | last post by:
Hi! Is it possible to capture an event when user leaves the page and execute some code? Not when he closes the window. Any ideas?
3
by: Pradeep Kumar C | last post by:
Hi , I am working on a ASP.Net Web Application which need some requirement as given below. Let's say two user's A and B. When a User A Assign a task to B , Then B need to get some sort of...
0
by: Cell | last post by:
Hi, I have searched for this but the only thing I can find is somebody that tells wx.RESIZE_BORDER is the style to look for. When I apply this in my code I am still able to resize the frame....
2
by: Chamomile | last post by:
Does anyone know a way to disable the 'refresh alert' windown that pops up in ie when document.location.reload() is used on a page that has post data? In thecontext I'm using reload() this...
7
by: Peted | last post by:
Hi, im hoping someone cane provide or point to a definitive accurate explantion of dotnet compilation when run and the best way to optimise peformace when dotnet code is run first time and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.