您现在的位置:首页 >> 前端 >> 内容

from表单序列化提交

时间:2017/1/20 9:53:29 点击:

  核心提示:// ----ajaxbegin$.ajax({type: POST,url: ../compRule/updateRuleById?tids= + compTableName_val + isRep...
// ----ajax  begin
$.ajax({

    type: "POST",
    url: "../compRule/updateRuleById?tids=" + compTableName_val + "&isReportName=" + $('#isReport_update').val() + "&heji_add=" + $('#heji_update').val(),
    async: false,
    data: $("#update_form1").serialize(),
    dataType: "text",
    success: function(data) {
        $("#search").click();
        $.success("操作成功");

        setTimeout(function() {
            layer.closeAll();
        },
        1000);
    },
    error: function(data) {
        $.fail('操作失败!');
    }
});
//----ajax end

用ajax提交到后台,要是用序列化接收不到相应的值,或值是Null,就把值拼到url上

Tags:FR RO OM M表 
作者:网络 来源:ysxybyb的博客