Save? Really?





-13
Date Submitted Sun. Nov. 12th, 2006 6:11 AM
Revision 1 of 1
Scripter shachi
Tags confirmation | JavaScript | saving
Comments 2 comments
Just confirms if the user really wants to save the page or just hit the Ctrl+S accidentally. Works in FF maybe in IE too.


<html>
<head>
<script type="text/javascript">
function captureSave(e){
e = e || window.event;
if(e.ctrlKey && e.keyCode == 83){
var saveconf = window.confirm("Are you sure you want to save??");

if(saveconf){
return true;
} else {
return false;
}
}
}
document.onkeydown = captureSave;
</script>
<style type="text/css">

</style>
</head>
<body>

</body>
</html>


 

Shachi Bista

Comments

Comments Doesn't Work
Wed. Nov. 22nd, 2006 6:51 PM    Helper snowdonkey
Comments which browser you tested?
Mon. Dec. 18th, 2006 5:46 AM    Syntax Master sundaramkumar

Voting