|
I'm trying to implement a 2-stage delete confirmation JS, I can get one stage (Ok to delete?) working but not the both.
Essentially this is how it's meant to work.
1) A record count is generated via ASP and stored as "strRecCount"
2) The onclick property of the delete button calls the JS.
3) If the record count <> 0, ie records exist, then alert and return to page
4) If record count = 0, then display confirmation "Ok to delete"
5) Ok, proceed to update page
Here's my present code. I'm sure its something really simple, but I can't figure it out - doh!
<script>
function confirmDelete()
{
var recCount = "<%=strRecCount%>";
if (recCount <> "0")
{
alert("Related records exist - cannot delete")
return false
}
if (confirm("Delete Category?"))
{
document.location.href = ("/forum/proSysCat_editUpd.html")
}
else
return false;
}
</script>
|
|
|
|
|
|
|
|