Ajax多表单提交跳过表单

时间:2016-06-11 18:19:11

标签: javascript php jquery ajax forms

我有复选框表单可以向我的网站提交多个项目,如果我选择的项目超过5-10项,则会跳过其中一些项目 并在控制台日志“提交/项目500(内部服务器错误)”

中显示此错误
   $('#submit_selected').one('click', function () {
        $('.loading_gif2').css({visibility: 'visible'});
        $('.loading_gif2').append('<p class="submit_process">Submitting f      orms...</p>');
        var forms = $('form');
        for (var i = 0; i < forms.length; i++) {
            var formId = forms[i].id;
            if ($("#" + formId + "_checkbox").is(':checked')) {
                var form = $('#' + formId);

                    $.ajax({
                        url: "create/item",
                        method: "POST",
                        data: form.serialize(),
                        dataType: "html",
                        success: function () {
                            location.reload();
                            $('.submit_process').remove();
                            $('.loading_gif2').css({visibility: 'hidden'});
                        }, fail: function (jqXHR, textStatus) {
                            console.log("jq+ "+jqXHR+" status"+textStatus);
                        }
                    });
                }
            }
        });

0 个答案:

没有答案