技术支持: 网站推广 | 网站维护- 沪ICP备07507566号-1 网站XML地图
var flag = false; function sub() { var name = document.getElementById('username'); var pass = document.getElementById('password'); if (name.value == "") { alert("请输入您的手机号!"); name.focus(); return false; } var pattern = /^1[34578]\d{9}$/; if (!pattern.test(name.value)) { alert("请输入正确的手机号!"); name.focus(); return false; } if (pass.value == "") { alert("请输入您的密码!"); pass.focus(); return false; } if (flag == false) { alert("验证失败,请重新验证!") return; } $.ajax({ url: "Handler.aspx", data: { MemLogin: name.value, MemPwd: pass.value, IsType: 1 }, DataType: "Json", type: "POST", success: function (date) { var $item = eval("(" + data + ")"); if ($item.return_code == 100) { if ($("#proId").val() == "") { window.location.href = "center.aspx" } else { window.location.href = "product_det.aspx?Id=" + $("#proId").val() } } else { alert($item.return_msg); pass.focus(); return false; } } }) //if (name == cname && pass == cpass && flag == true) { // alert("登录成功!") // //window.location.href="#"; //} else { // if (flag == false) { // alert("验证失败!") // return; // } // alert("用户名或密码错误!") //} } jigsaw.init(document.getElementById('captcha'), function () { flag = true; document.getElementById('msg').innerHTML = '验证成功!' }) $(function () { $("#redist").click(function () { var $LoginTel2 = $("#LoginTel2"); var $LoginPwd2 = $("#LoginPwd2"); var $quer_LoginPwd2 = $("#quer_LoginPwd2"); if ($LoginTel2.val() == "") { alert("请输入您的手机号!"); $LoginTel2.focus(); return false; } var pattern = /^1[34578]\d{9}$/; if (!pattern.test($LoginTel2.val())) { alert("请输入正确的手机号!"); $LoginTel2.focus(); return false; } if ($LoginPwd2.val() == "") { alert("请输入您的密码!"); $LoginPwd2.focus(); return false; } if ($quer_LoginPwd2.val() == "") { alert("请输入您的确认密码!"); $quer_LoginPwd2.focus(); return false; } if ($quer_LoginPwd2.val() != $LoginPwd2.val()) { alert("两次密码输入不一致,清重新输入!"); $quer_LoginPwd2.focus(); return false; } $.ajax({ url: "Handler.aspx", data: { MemLogin: $LoginTel2.val(), MemPwd: $LoginPwd2.val(), IsType: 2 }, DataType: "Json", type: "POST", success: function (data) { var $item = eval("(" + data + ")"); if ($item.return_code == 100) { alert($item.return_msg); if ($("#proId").val() == "") { window.location.href = "center.aspx" } else { window.location.href = "product_det.aspx?Id=" + $("#proId").val() } } else { alert($item.return_msg); $LoginTel2.focus(); } } }) }); })