خرید بک لینک

Vote count: 0

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?

asked 55 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 24 فروردين 1395 ساعت: 2:42

صفحه بندی