注册 登录
编程论坛 ASP技术论坛

JQuery Ajax Serialize 表单,后台如何获取表单中某个控件的值

Kandy123 发布于 2012-08-17 11:08, 1374 次点击
前台代码 JS
if (flag) {
        $(this).attr({"disabled":"disabled"}).attr({"value":"提交中,请稍等"});
        $.ajax({
            type: "POST",
            url: "ReceiveParam.asp?r="+Math.random(),
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            data: sparam,
            success: function(result) {
                if (result == 1) {
                    window.location = "ReceiveParam.asp";
                }
            }
        });
    }

前台页面的Form中 有个 文本框的 id为 username 后台如何获取这个 username的 值


2 回复
#2
xmlz2012-08-17 18:12
后台获取方式与普通提交方式相同。
前台应该指定文本框的name

后台request.form("username")
#3
netlin2012-08-18 08:29
在Ajax中,能这样提交前台的form吗?
1