日期:2014-05-17  浏览次数:20540 次

ajax提交表单的问题(挺棘手的)
首先:
     1、页面有个表单:
   <form id="form1" action="input.aspx" method="post" enctype="multipart/form-data">
    //里面有多个text,多个file文本框。
    //还有一个按钮
      <input type="submit" id="btnReg" value="注册" onclick="return checkAll()" />
  </form>

   2、还有个提交表单代码:标题一    
$("#tb input").live("change", function () { //动态绑定每个file
                var file = $(this);
                file.attr("name", "fileSrc");
                if (CheckFilePath($(this))) {
                    $('#form1').ajaxSubmit({
                        url: 'input.aspx?action=' + "up",
                        type: "get",
                        success: function (data, status) {
                            if (status == "success") {
                            if (data == "no") {
                            alert("不能上传大于1M的图片");
                            file.parent().html("<input type='file' name='file'/>");
                                    return;
                                }
                                msg(file, "ok");
                            }
                        }
                    });
                }
                else {