怎么用js验证日期用下拉列表的形式
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>雇员注册验证表单</title>
<script type="text/javascript">
function validate(f) {
var usernumber = f.usernumber.value;
var username = f.username.value;
var userjob = f.userjob.value;
/* var userdate = f.userdate.value;*/
var basicsalary = f.basicsalary.value;
var bonus = f.bonus.value;
if(!/^\d+$/.test(usernumber)){
alert("雇员编号只能是数字");
f.usernumber.focus();
f.usernumber.select();
return false;
}
if(!/^\S+$/.test(username)){
alert("雇员姓名不能为空");
f.username.focus();
f.username.select();
return false;
}
if(!/^\S+$/.test(userjob)){
alert("雇员工作不能为空");
f.userjob.focus;
f.userjob.select();
return false;
}
if(!/^\d+\.{0,1}\d{0,1}$/.test(basicsalary)){
alert("基本工资必须是数字(小数)");
f.basicsalary.focus();
f.basicsalary.select();
return false;
}
if(!/^\d*\.{0,1}\d{0,1}$/.test(bonus)){
alert("奖金必须是数字(小数)");
f.bonus.focus();
f.bonus.select();
return false;
}
alert("注册成功");
return ture;
}
</script>
</head>
<body>
<form action="" method="post" name="myform" onSubmit="return validate(this)">
雇员编号:<input type="text" name="usernumber" maxlength="3" /><br /><br />
雇员姓名:<input type="text" name="username" /><br /><br />
雇员工作:<input type="text" name="userjob" /><br /><br />
雇佣日期:<select name="userdate1"><option value="">请选择</option></select>年<select name="userdate2"><option value="">请选择</option></select>月<select name="userdate3"><option value="">请选择</option></select>日<br /><br />
基本工资:<input type="text" name="basicsalary" min="1" max="5" /><br /><br />
奖金:<input type="text" name="bonus" /><br /><br />
<input type="submit" value="注册" /> <input type="reset" value="重置" />
</form>
</body>
</html>
^(?:(?:1[6-9]
[解决办法]
[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]
[解决办法]
1[0-2])\1(?:0?[1-9]
[解决办法]
1[0-9]
[解决办法]
2[0-8])
[解决办法]
(?:0?[13-9]
[解决办法]
1[0-2])\1(?:29
[解决办法]
30)
[解决办法]
(?:0?[13578]
[解决办法]
1[02])\1(?:31))
[解决办法]
(?:(?:1[6-9]
[解决办法]
[2-9][0-9])(?:0[48]
[解决办法]
[2468][048]
[解决办法]
[13579][26])
[解决办法]
(?:16
[解决办法]
[2468][048]
[解决办法]
[3579][26])00)([-/.]?)0?2\2(?:29))$