I have a file on our local database page that needs to be able to delete a client after prompting the user to confirm deletion.
The function deleteClient
already exists and is very long and elaborate as there are several steps in removing the information from the database in the proper way.
I have set up the page so that when the user clicks that delete button it calls the javascript function confirmdelete()
then it should call the ASP function to do the deed.
How do I call an ASP function from a javascript function?
<SCRIPT TYPE="text/javascript">
function confirmdelete(){
if (window.confirm('Are you sure you want to delete client?'){
// How do I call deleteClient here?
}else
return false;
}
</SCRIPT>
<%
Function deleteClient
...
...
End Function
%>
<FORM NAME=addclient METHOD=post ACTION="...">
<INPUT type=Submit name=btnSubmit value="Delete" onClick="confirmdelete()">
</FORM>