<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var iscommit = false;
function dosubmit(){
if(!iscommit){
iscommit = true;
return true;
}else{
return false;
}
}
</script>
</head>
<body>
<form action="/day07/DoFormServlet" method="post" onsubmit="return dosubmit()">
用户名:<input type="text" name="user"><br>
<input type="submit" value="登录">
</form>
</body>
</html>
//其实用js来防止表单重复提交是防不死的,我可以打开你的网页源代码,然后另存为------然后将你的js代码改掉,再去注册,就可以重复注册了,防君子,不防小人,最好就是在服务端来处理
//表单重复提交