Gossamer Forum
Home : Products : DBMan : Customization :

Confirm statement

Quote Reply
Confirm statement
I have the following statements in the admin section. The problem I'm having is that even
when the "cancel" button is clicked on the alert(confirm) box it still deletes the user.
What am I doing wrong?

<script language="javascript">

function deletedealer() {
if (confirm("Are you sure you want to delete this dealer"))
{
alert("delete");
return true;
}
else {
alert("not delete");
return false;
}
}

</script>

<input type=submit name=delete value="Delete Dealer" onclick="deletedealer()">

Quote Reply
Re: Confirm statement In reply to
It works if I put "history.go(-1)" in the "else" section of the if statement but I don't really want it to work that way.

Quote Reply
Re: Confirm statement In reply to
Try:
<input type=submit name=delete value="Delete Dealer" onclick="return deletedealer()">

That should do it.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Confirm statement In reply to
It works but I get a syntax error on that line now. Don't worry about it though... At least it now works... Thanks again...

Are you able to help me solve my other problem in the "Work Around / Admin - Help!!" thread?

Quote Reply
Re: Confirm statement In reply to
It wasn't a problem in that line actually. It was the line below. I removed it and now I get no error messages :)

Now I really need my other problem solved in that other thread.