How to use jQuery .ajax to my form's action

前端 未结 5 2260
你的背包
你的背包 2021-02-08 12:54

I changed my coding style for php and jQuery, but my Registration

$(\"#reg_form_company\").bind(\"submit\", function() {
    $.fancybox.showActivity();
    $.aj         


        
5条回答
  •  無奈伤痛
    2021-02-08 13:05

    you must refere your form instead of $(this)

    give your form an id or class ex :

    [...]

    and in JQuery :

    $.ajax({
            type     : "POST",
            cache    : false,
            url      : $('#MyForm').attr('action'),
            data     : $('#MyForm').serializeArray(),
            success  : function(data) {
                $(".printArea").empty().append(data).css('visibility','visible');
            }
    });
    

提交回复
热议问题