jave学习第四节

<%@ page language="java" contentType="text/html; charset=GB18030"
	pageEncoding="GB18030"%>
<!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=GB18030">
		<title>Insert title here</title>
		<script type="text/javascript">
	function test() {
		var name_1 = document.formData.password.value;
		if(name_1.length<6){
		alert("密码不足六位,重新输入");
		return false;
		}
		return true;
	}
</script>

	</head>
	<body>
		<form action="../servlet/LoginServlet" method="post" name="formData">
			用户名:
			<input type="text" name="username" value="neusoft" />
			<br>
			密码:  
			<input type="password" name="password" value="123456">
			<br>
			<input type="submit" value="提交" οnclick="return test()">
			<input type="reset" value="重置">

		</form>
	</body>
</html>

猜你喜欢

转载自blog.csdn.net/u010256329/article/details/9426097