function checkinput() { var uid,pwd,regjm; uid = document.getElementById("username").value; pwd = document.getElementById("password").value; regjm = document.getElementById("regjm").value; if (uid=="") { layer.alert("请输入帐号", { title: '温馨提示' }); login_frm.username.focus(); return false; } else if(pwd =="") { layer.alert("请输入密码", { title: '温馨提示' }); login_frm.password.focus(); return false; } else if (regjm=="") { layer.alert("请输入验证码", { title: '温馨提示' }); login_frm.regjm.focus(); return false; } else { userlogin(); return false; } } function getFormQueryString(frmID) { var frmID = document.getElementById(frmID); var i, queryString = "", and = ""; var item; var itemValue; var form_data = []; for (i = 0; i < frmID.length; i++) { item = frmID[i]; if (item.name != '') { if (item.type == 'select-one') { itemValue = item.options[item.selectedIndex].value; } else if (item.type == 'checkbox' || item.type == 'radio') { if (item.checked == false) { continue; } itemValue = item.value; } else if (item.type == 'button' || item.type == 'submit' || item.type == 'reset' || item.type == 'image') { continue; } else { itemValue = item.value; } //itemValue = escape(itemValue); queryString += and + item.name + ':' + '"' + itemValue + '"'; and = ","; } } queryString = "[{ " + queryString + " }]" //alert(queryString); form_data = eval(queryString); return form_data[0]; } function userlogin(){ //读取表单 var postData = [this.getFormQueryString("login_frm_ajax")]; if (postData) { $.post("/user/chkuserlogin.asp", postData[0], function (data) { var arr = eval('(' + data + ')'); if (arr.status == 1) { layer.confirm(arr.msg, { title: '温馨提示', btn: ['确认'] //按钮 }, function () { window.location.href = arr.url }) } else { layer.alert(arr.msg, { title: "温馨提示" }); } }); }; } content='
用户名:密码:验证码:点击更换验证码
'; document.write(content);