81,094
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function checkname(){
ischeck = false;
//alert(ischeck)
if(document.getElementById("name").value==""){
alert("name must not be empty!");
document.getElementById("name").focus();
//ischeck = false;
//return false;
}else{
ischeck = true;
//location.href="stu_test.asp";
document.form1.action="stu_test.asp";
document.form1.submit();
}
}
</script>
</head>
<body style="text-align:center">
<form name="form1" id="form1" action="" method="post">
<input name="name" id="name" type="text" value="" />
<div style="border:1px solid #cccccc;margin-left:auto;margin-right:auto;width:100px;margin-top:30px;text-align:center; cursor:pointer" onClick="return checkname()" >登录</div>
</form>
</body>
</html>
这串是我本地测试通过的了。。。