<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<html>
<head>
<title>JSP for loginForm form</title>
</head>
<body>
<script language="javascript" type="text/javascript">
function login()
{
if(document.loginForm.repassword.value=="")
{
alert('确认密码不能为空!');
return false;
}
if((document.loginForm.password.value.length)<3)
{
alert('密码最少为4位')
return false;
}
if(document.loginForm.repassword.value!=document.loginForm.password.value)
{
alert('密码与确认密码必须一致')
return false;
}
}
</script>
<h4>Login</h4>
<html:errors /><br/>
<html:form action="/login" focus="loginForm" οnsubmit="return login();">
username : <html:text property="username"/><br/>
password : <html:password property="password"/><br/>
repassword: <html:password property="repassword"/><br/><br/>
<html:submit/><html:cancel/>
</html:form>
<a href="/line/form/register.jsp">Register</a>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------------------------------------------
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<html>
<head>
<title>JSP for loginForm form</title>
</head>
<body>
<script language="javascript" type="text/javascript">
function login()
{
if(document.loginForm.repassword.value=="")
{
alert('repassword is required !');
return false;
}
}
</script>
<h4>Login</h4>
<html:errors /><br/>
<form name="loginForm" action=/line/login.do onSubmit="return login();">
username : <input name="username" type="text"/><br/>
password : <input name="password" type="password"/><br/>
repassword: <input name="repassword" type="password"/><br/><br/>
<input name="submit" type="submit" value="submit">
</form>
<br>
<a href="/line/form/register.jsp">Register</a>
</form>
</body>
</html>