I think you can shorten your function to:


function confirmBeforeDeletion()
{
return confirm("Are you sure to delete");
}

if your function returns true (the user selects 'Yes') the form...