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>