<html>
<head>
<base href="<%=basePath%>">
<script type="text/javascript">
function check(){
var name1 = document.form1.name1.value;
var password1 = document.form1.password1.value;
var email = document.form1.email.value;
if(name1 == ""){
alert("用户名不能为空!");
return false;
}
else if(password1.length<4 || password1==""){
alert("密码不能少于4位");
return false;
}else {
var idxEmail = email.indexOf('@');
if(idxEmail <=0 || idxEmail == email.length - 1){
alert("Email地址格式不合法");
return false;
}
}
}
</script>
</head>
<body>
<form action="registerOK.jsp" method="post" name="form1" onsubmit="return check()">
<input type="text" name="name1"/>
<input type="password" name="password1"/>
<input type="text" name="email" />
<input type="submit" value="提交">
</form>
</body>
</html>