// JavaScript Document
function checkReg()
{
names=form1.name.value;
password=form1.psw.value;
password2=form1.pswc.value;
email=form1.e_mail.value;
realname=form1.realname.value;
number=form1.number.value;
country=form1.country.value;
phone=form1.userphone.value;
address=form1.address.value;
if(names=="")
{
alert("用户名不能为空");
form1.name.focus();
}
else if(password=="")
{
alert("密码不能为空");
form1.psw.focus();
}
else if(password.length<6)
{
alert("密码长度至少为6位");
form1.psw.focus();
}
else if(password2=="")
{
alert("请填写确认密码");
form1.pswc.focus();
}
else if(password!=password2)
{
alert("两次输入的密码不一致");
form1.psw.focus();
}
else if(email=="")
{
alert("Email地址不能为空");
form1.e_mail.focus();
}
else if(checkemail(email))
{
alert("邮箱地址格式不正确");
form1.e_mail.focus();
}
else if(realname=="")
{
alert("请填写真实姓名");
form1.realname.focus();
}
else if(!isNaN(parseInt(realname)))
{
alert("请如实填写真实姓名");
form1.realname.focus();
}
else if(number=="")
{
alert("请填写身份证号码");
form1.number.focus();
}
else if(isNaN(parseInt(number)))
{
alert("身份证号码只能是数字");
form1.number.focus();
}
else if(country=="")
{
alert("年龄不能为空");
form1.country.focus();
}
else if(isNaN(parseInt(country)))
{
alert("年龄只能是数字");
form1.country.focus();
}
else if(phone=="")
{
alert("电话号码不能为空");
form1.userphone.focus();
}
else if(address=="")
{
alert("联系地址不能为空");
form1.address.focus();
}
else
{
form1.submit();
}
}