Jquery post 供以后使用复制粘贴就行

来源:互联网 发布:视频双屏播放软件 编辑:程序博客网 时间:2024/06/05 09:03
                if (Request.Form["MobilePhone"] != null)                {                    Response.ContentType = "text/plain";                    string MobilePhone = Request.Form["MobilePhone"].ToString();                    if (new Module.TRegisteredInfo().FirstIsExists(MobilePhone) == true)                    {                        Response.Write("true");                    }                    else                    {                        Response.Write("false");                    }                    Response.End();                }
<pre name="code" class="javascript"><script language="javascript" type="text/javascript">        $(document).ready(function () {            $("#txtMobileNumber").focus();            $("#txtMobileNumber").blur(function () {                var mp = $("#txtMobileNumber").val();                var phone = /^1[3|5|8][0-9]\d{4,8}$/;                if (!phone.test(mp)) {                    $("#txtBtnNext").attr("disabled", "disabled");                    $("#txtDivMobilePhoneSign").html("手机号格式不正确!");                    return false;                }                else {                    $.post("TFirstStep.aspx", { MobilePhone: mp }, function (Exist, status) {                        if (status == "success") {                            if (Exist == "true") {                                $("#txtBtnNext").attr("disabled", "disabled");                                $("#txtDivMobilePhoneSign").html("该手机号码已存在!");                                return false;                            } else {                                $("#txtBtnNext").removeAttr("disabled");                                $("#txtDivMobilePhoneSign").html("手机验证通过!");                            }                        }                        else {                            alert("服务器传输错误!");                        }                    });                }            })        })    </script>


                                             
0 0
原创粉丝点击