English 中文(简体)
表格:多次交火,每次交火后增加一次。
原标题:form.submit fires multiple times, one extra time after each response

我有一份表格。 提交这种火力会多次。 这是第一次罚款。 在我回击之后,如果我再次点击提交纽特,它就两次开火。 然后是ric。 如同每次回复回来一样,在 but子被点击的下一个时间,提交火。

RetrievePassword = function () {
    var $popup = $("#fancybox-outer");
    var form = $popup.find("form");
    form.submit(function (e) {
        var data = form.serialize();
        var url = form.attr( action );
        $.ajax({
            type: "POST",
            url: url,
            data: data,
            dataType: "json",
            success: function (response) {
                if (response.Success) {
                    $.fancybox.close();
                }

                alert(response.Message);
            },
            error: function (xhr, status, error) {
                alert(xhr.statusText);
            }
        });

        e.cancelBubble = true;
        if (e.stopPropagation) e.stopPropagation();
        return false;
    });

};

我甚至不肯定如何对此进行ug击。 ......

最佳回答

我假设你正在多次打电话<代码>RetrievePasword()。 每当你打电话一次,将登记onsubmit。

解决办法是只登记手稿一次。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签