<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function checkForm(){
var username = document.getElementById("username");
if(username.value==""){
alert("用户名不能为空!");
return false;
}
return true;
}
</script>
</head>
<body>
<form action="/cookie/UserServlet" method="post" onsubmit="return checkForm()">
用户名:<input type="text" value="" name="username" id="username"/><br>
密码:<input type="password" value="" name="pwd"/><br>
<input type="submit" value="提交"/>
<input type="button" value="取消"/>
</form>
</body>