I think you can shorten your function to:
Code:
function confirmBeforeDeletion()
{
return confirm("Are you sure to delete");
}
if your function returns true (the user selects 'Yes') the form will submit as normal, while if the form returns false the form will not submit. The minimum change you need to do is replace the 'return' in the code you posted with 'return false' i.e.:
Code:
function confirmBeforeDeletion
{
var con = confirm("Are you sure to delete");
if(con == true)
{
form.submit;
}
else
{
return false;
}
}
Bookmarks