Then you can't do that on the client side.
You need set some kind of flag or variable to tell your server to run code to delete the records.
Test the flag on the server.
Run the code to delete the records.
Load th epage again.
I have added an example below to illustrate the process.
Note that the first time the page is loaded request("deleteAll") will be empty and the code wont run.
Code:
<% @language = "vbscript" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
'Test the flag
if request("deleteAll") = "YES" then call DeleteAllRecords
%>
<script language=javascript>
function checkAll()
{
var agree = confirm("Are you sure you want to do this?");
if (agree)
//Set the flag to YES if confirmed
{form1.deleteAll.value='YES';form1.submit();}
}
</script>
</script>
<form name="form1" method="POST">
<input type="button" onclick="checkAll()" value="Check All">
<input type="hidden" name="deleteAll" value="NO">
</form>
</body>
</html>
<%
sub DeleteAllRecords()
'VBScript code goes here to delete records
Response.write("All Records Deleted")
end sub
%>
======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================