I am trying to add a javascript alert to my form, the problem I am having is that when the user clicks cancel, the form still gets submitted?.
In the head I have :
<head>
<script type="text/javascript">
function confirmDelete() {if(confirm('Are you sure you want to delete this category ?'))
alert('Category Deleted !');
else alert('Cancelled !')}
</script>
</head>
My link uses the following :
a onClick="confirmDelete()"
Im not sure why clicking cancel still submits it?, is it possible to show Cancelled ! for 2 seconds and then close also ?.