I need this function to fail and not do the confirm, or submit the form and stay on the page if the sub function comes back false.
function doDelete()
{
if (THIS FAILS!()-STAY ON PAGE!)
// do something here
if (confirm("Are you sure you want to update and then delete this hot part?"))
{
return true;
}
else
{
return false;
}
}
Returning false from a form submit callback will result in the page not being submitted. You can also just return the result of the confirm, rather than using an if-else.