I have a view that has a delete button on it that makes a form in each row of the table
@using (Html.BeginForm("Delete",
"FP/WorkItem",
new { fId = Model.FPId, workId = @w.FId }))
{
<input name="deleteWorkItem" type="submit" value="Delete" class="btn btn-default" onclick="retu confirm('Are you sure?');" />
}
that works all well and good but i don't want the crummy alert dialog. I want to use a nice thing like bootbox. So i modify this to add some js:
$("input[name = 'deleteWorkItem']").click(function (e) {
//retu confirm('Delete selected item?');
e.preventDefault();
bootbox.confirm("Delete selected item?", function (result) {
retu result;
});
});
without the preventDefault the confirm box never appears. with the preventDefault the form doesn't post back if the user decides to not delete. How can i have both?
