Hi,
I have an ASP page with dynamically generated links. Each link is for deleting the item next to it. I am trying to set it up so that when you click Del you get an alert box that asks you if you are sure. If you click OK it takes goes to the page that deletes the item and if you click Cancel it goes back to the page you were just on (with the list of items with Del next to them).
In <HEAD></HEAD> I have:
<script language="javascript" type="text/javascript">
<!--
function AlertBox2() {
if(confirm("Confirm Delete"))
{
}
}
//-->
</script>
And my links look like this:
<a href='deletecase.asp?CaseID=57' onclick='AlertBox2()'>Del</a>
The problem I had was that it would go to the deletecase.asp page whether I clicked OK or Cancel. What do I need to add to the function to make it work properly?
I am a total beginner at Javascript so apologies for the potential stupidity/simplicity of the question!
cheers
Ed
I have an ASP page with dynamically generated links. Each link is for deleting the item next to it. I am trying to set it up so that when you click Del you get an alert box that asks you if you are sure. If you click OK it takes goes to the page that deletes the item and if you click Cancel it goes back to the page you were just on (with the list of items with Del next to them).
In <HEAD></HEAD> I have:
<script language="javascript" type="text/javascript">
<!--
function AlertBox2() {
if(confirm("Confirm Delete"))
{
}
}
//-->
</script>
And my links look like this:
<a href='deletecase.asp?CaseID=57' onclick='AlertBox2()'>Del</a>
The problem I had was that it would go to the deletecase.asp page whether I clicked OK or Cancel. What do I need to add to the function to make it work properly?
I am a total beginner at Javascript so apologies for the potential stupidity/simplicity of the question!
cheers
Ed