[RESOLVED] Jasascript - Are you sure you want to leave this page
I see it all over the place...you are on a web site...you accidentally click the X instead of the minimize/maximize button...and the Javascript prompts you "Are you sure you want to leave this page?"
How is this done?
Re: Jasascript - Are you sure you want to leave this page
Re: Jasascript - Are you sure you want to leave this page
A little javascript should do it.
Code:
<html>
<head>
<script language="javascript" type="text/javascript">
window.onbeforeunload = askConfirm;
function askConfirm(){
return "You have unsaved changes.";
}
</script>
</head>
<body>
</body>
</html>
Re: Jasascript - Are you sure you want to leave this page
@ rrrctraptor31
Instead of putting the code in each page put it in an external javascipt file.
Re: Jasascript - Are you sure you want to leave this page
thank you both...i plan on using this in a time clock system that I have build...it used DHTML windows...so there is only one real page...everything else is in <#includes>