<script type="text/javascript">
function Cancle() {
$("#username").val("");
$("#userpwd").val("");
}
//文本框校验
$(function () {
//回车就能触发验证提交表单
$(document).keydown(function (e) {
var code = e.keyCode;
if (code == 13) {
CheckUser();
}
});
});
function CheckUser() {
var loginID = jQuery("#username").val();
var pwd = jQuery("#userpwd").val();
if (checkdata(jQuery("#frmLogin"))) {
jQuery.ajaxSetup({ cache: false });
var result = jQuery.ajax({
url: "/Sys/logincheck.aspx",
type: 'GET',
async: false,
data: { loginID: loginID, password: pwd },
success: function (data) {
return data;
}
});
if (result.responseText == "N") {
alert("用户名或密码错误!");
}
else {
window.location.href = "/Default/Index.aspx";
}
}
}
</script>