Click to See Complete Forum and Search --> : Confirm Message


nickcrispini
05-17-2004, 08:44 AM
I have an image embedded within a <a href>. In the <a href> I've a onMouseUp that calls a Javascript function which produces a confirm box:

The image button:

<a href="actions.asp?delete=true" onMouseUp="return checkAction()"><img src="assets/btn_delete.jpg"></a>


Javascript function:

function checkAction()
{
confirmMessage = window.confirm("Are you sure?");
window.status=(confirmMessage)?'confirm: true':'confirm: false';
return confirmMessage;
}

The problem is that if I click 'OK' to confirm that I want to perfrom the action nothing happens i.e the return true isn't working.

Any suggestions will be appreciated.

Pittimann
05-17-2004, 09:01 AM
Hi!

You could try something like this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function checkAction(){
confirmMessage = window.confirm("Are you sure?");
window.status=(confirmMessage)?confirmIt= true:confirmIt= false;
return confirmIt;
}
//-->
</script>
</head>
<body>
<a href="actions.asp?delete=true" onclick="return checkAction()"><img src="assets/btn_delete.jpg"></a>
</body>
</html>Cheers - Pit