谁帮我看看生日验证怎么写
<%@page contentType="text/html; charset=gb2312"%>
<html>
<head>
<meta http-equiv="作者" content="武迪"/>
<script type="text/JavaScript" language="JavaScript">
/*function check()
{
var UloginName=document.form1.txtUloginName.value;
var Uname=document.form1.txtUname.value;
var Upassword=document.form1.txtUpassword.value;
var reUpassword=document.form1.txtreUpassword.value;
var UE_Mail=document.form1.txtUE_Mail.value;
if ((UloginName.length !=0) && (Uname.length !=0) && (Upassword.length !=0) && (UE_Mail.length !=0) &&(txtRand.length!=0))
{
if (reUpassword==Upassword)
{
if ((UE_Mail.indexOf("@",0)==-1) || (UE_Mail.indexOf(".",0)==-1))
{
alert("电子邮件格式不正确!");
return false;
}else
{
return true;
}
}else
{
alert("2次密码必须相同!")
return false;
}
}else
{
alert("各项均不能为空!");
return false;
}*/
function check()
{
var UloginName=document.form1.txtUloginName.value;
var Uname=document.form1.txtUname.value;
var Upassword=document.form1.txtUpassword.value;
var reUpassword=document.form1.txtreUpassword.value;
var birthday = document.form1.birthday.value;
var UE_Mail=document.form1.txtUE_Mail.value;
var Rand = document.form1.txtRand.value;
var patrn=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
if(UloginName.length==0) //验证是否输入了用户名
{
alert("请输入用户名");
document.form1.txtUloginName.focus();
return false;
}
if(Upassword.length==0 || Upassword.length<6 || Upassword.length>16 ) //验证是否输入了密码
{
alert("请输入正确长度的密码");
document.form1.txtUpassword.focus();
return false;
}
if(reUpassword.length==0) //验证是否再次输入了密码
{
alert("请再次输入密码");
document.form1.txtreUpassword.focus();
return false;
}
if(reUpassword != Upassword) //验证2次输入的是否相同
{
alert("2次输入的密码必须相同");
document.form1.txtreUpassword.focus();
return false;
}
if(Uname.length==0) //验证是否输入了昵称
{
alert("请输入昵称");
document.form1.txtUname.focus();
return false;
}
if(birthday.length==0) //验证是否输入了生日
{
alert("请输入生日");
document.form1.birthday.focus();
return false;
}
//验证生日合法性
if(UE_Mail.length==0) //验证是否输入了Email
{
alert("请输入Email");
document.form1.txtUE_Mail.focus();
return false;
}
//if (UE_Mail.indexOf("@",0)==-1) || (UE_Mail.indexOf(".",0)==-1 || )
if (!patrn.exec(UE_Mail))
{
alert("电子邮件格式不正确!");
return false;
}
if(Rand.length==0) //验证是否输入了验证码
{
alert("请输入验证码");
document.form1.txtRand.focus();
return false;
}
}
</script>
<title>用户注册</title>
<style type="text/css">
<!--
.word220 { PADDING-LEFT: 15px; FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffffff
}
.word26 { PADDING-LEFT: 15px; FONT-SIZE: 12px; COLOR: #0066cc
}
.word28 { FONT-SIZE: 12px; COLOR: #000000
}
.STYLE2 {font-size: 12px}
body {
margin-top: 0px;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
// Kaosweaver Calendar Settings - do not remove
// by Paul Davis - http://www.kaosweaver.com
// KW_lang[English]
// KW_order[2,0,1]
// KW_del1[/]
// KW_del2[/]
// KW_dd[true]
// KW_cWidth[170]
// KW_fd[-1]
var sDate = new Array();
var mName = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var wName = new Array("Su","Mo","Tu","We","Th","Fr","Sa")
var cFontName = "宋体;"
var KW_color = new Array("#ffffff","#ffcccc","#999999","#ffffff","#ccffcc","#cccccc","#000000","#000000")
var KW_cl=0;
var KW_od=-1;
var KW_tmo=0;
var KW_cWidth=170;
var KW_fd=-1;
var descx=-1;
var descy=-1;
var bwNN=(document.captureEvents)?1:0;
function popmousemove(e){descx=(bwNN)?e.pageX:event.x;descy=(bwNN)?e.pageY:event.y}
function KW_mouseInit(){
if(bwNN)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=popmousemove;
}
function m_class(m,d,y) {
this.month=m;this.day=d;this.year=y;this.output=this.year+"/"+this.month+"/"+this.day;
var kd=new Date();this.special=checkDates(this.month,this.day,this.year)
this.today=((kd.getMonth()+1)==this.month && kd.getDate()==this.day && kd.getFullYear()==this.year)
var td=new Date(this.year, (this.month-1), this.day+KW_od);this.past=(KW_od==-1)?0:(kd>td)
var tf=new Date(kd.getFullYear(),kd.getMonth(),kd.getDate()+KW_fd);
var d1=new Date(this.year, (this.month-1), this.day);
this.future=(KW_fd==-1)?0:(tf<d1);
}