can't it just be
function confirmation() {
if !(confirm("Delete Record?")) {
return false;
}
}
?
if the user hits OK, then confirm("blah") is True and the url you have should run.
if the user hits CANCEL, confirm("blah") is not true and we check for !confirm() and if so, return false, which stops browser action of the clicking.
Notes:
Code:
<script type="text/javascript">
<!--
function confirmation() {
var answer = confirm("Delete Record?")
if (!answer){
window.location = "by_hand.php";
}
}
//-->
</script>
Get rid of the stuff in red, you're not writing for Netscape 4 or IE5 anymore.
Code:
<a href='delete.php?delete=$id&&&action=deleteemployee' onclick='confirmation()'><img src='images/delete.png' alt='Delete' Ttitle='Delete'spacebarclass='pngfix'></a>
Quote all your attribute values, escape your ampersands, keep spaces between your attributes, and remember that capitalisation matters (so generally lowercase everything in code).
I also would not put the title on the img. I'd probably have no title at all if you you are going to use one, put it on the anchor. The image already has an alt attribute.
Bookmarks