技術(shù)支持: 網(wǎng)站推廣 | 網(wǎng)站維護- 滬ICP備07507566號-1 網(wǎng)站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("用戶(hù)名或密碼錯誤!") //} } 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(); } } }) }); })