表单要求:
1、用户名不能为空,否则提示错误
2、用户名长度在6-12之间,否则提示错误
3、用户名只能为字母或数字(正则表达式),否则提示错误
4、有密码验证文本框,要求必须和密码文本框内容一致,否则提示错误
5、邮箱必须有一定格式(正则表达式),否则提示错误
6、以上条件全部达成,方可提交表单,否则不能提交
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--这里的CSS可以忽略-->
<style>
#error1{
font-size: 8px;
}
#error2{
font-size: 8px;
}
#error3{
font-size: 8px;
}
#start{
background-color: aquamarine;
height: 30px;
width: 60px;
border-radius: 25px;
}
#reset{
background-color: aquamarine;
height: 30px;
width: 60px;
border-radius: 25px;
}
table{
position: absolute;
border: 1px;
left:40%;
top: 20%;
}
#userpwd1,#userpwd2{
background-color: darkseagreen;
}
</style>
</head>
<body>
<script type="text/javascript">
window.onload=function(){
//用户名
var usernameElt=document.getElementById("username");
//错误信息1
var error1=document.getElementById("error1");
usernameElt.onblur=function(){
var username=usernameElt.value;
//清空字符串前后空白
username