codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  2 stage JS delete confirmation  BigJohnson at 12:12 on Tuesday, August 16, 2005
 

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>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Develop website with 3 tier architecture
•  Re: TaylorMade R11s Fairway Wood
•  Re:
•  What do you mean by ASP.NET MVC Execution Process?
•  Re:
•  Re:
•  one java progarm handle two socket connection
•  How to navigate database page?
•  "Fitting Wedges


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012