登录界面


<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function cheakname(){
				var a1 =document.x1.username.value;
				if(a1.length==0){
					alert("姓名不能为空")
					return false;
				}
				return true;
			}
			function cheakpassword(){
				var a1 = document.x1.password.value;
				var a2 = document.x1.password2.value;
				if(a1!=a2){
					alert("密码必须一致");
					return false;
				}
				if(a1.length==0){
					alert("密码为空")
					return false;
				}
				if(a2.length==0){
					alert("重写密码为空")
					return false;
				}
				return true;
			}
			function cheakyear(){
				var s1 = document.x1.year.value;
				if(s1.indexOf("20")!=0){
					alert("年份必须以20开头");
					return false
				}
				if(s1.length==0){
					alert("年份不能为空")
					return false;
				}
				return true;
			}
			function cheakday(){
				var s1 =document.x1.day.value;
				var s2= new RegExp("[1-31]");
				if(!s2.test(s1)){
					alert("日期必须在1—31之间");
					return false;
				}
				if(s1.length ==0){
					alert("日期不能为空");
				}
				return true;
			}
			function cheakmonth(){
				var a1 =document.x1.month.value;
				if(a1=="—选择月份—"){
					alert("月份不能为空")
					return false;
				}
				return true;
			}
			function cheakfrom(){
				if(cheakname()&&cheakpassword()&&cheakyear()&&cheakmonth()&&cheakday()){
					return true;
				}
				return false;
			}
		</script>
	</head>
	<body>
		<form name="x1" action="#" onsubmit="return cheakfrom(2)">
			<table>
				<tr>
					<td>
						用户名:
					</td>
					<td>
						<input type="text" name="username"  />
					</td>
				</tr>
				<tr>
					<td>
						密码:
					</td>
					<td>
						<input type="password" name="password" />
					</td>
				</tr>
				<tr>
					<td>
						再次输入密码:
					</td>
					<td>
						<input type="password" name="password2" />
					</td>
				</tr>
				<tr>
					<td>
						出生日期:
					</td>
					<td align="center">
						<input type="text" name="year" value="yyyy" size="7"/>年
					</td>
					<td align="center">
						<select name="month">
							<option>—选择月份—</option>
							<option >1</option>
							<option >2</option>
							<option >3</option>
							<option >4</option>
							<option >5</option>
							<option >6</option>
							<option >7</option>
							<option >8</option>
							<option >9</option>
							<option >10</option>
							<option >11</option>
							<option >12</option>
						</select>月
					</td>
					<td align="center">
						<input type="text" value="dd" name="day" size="3"/>日
					</td>
				</tr>
				<td colspan="2" align="center">
					<input type="submit" value="注册" />
					<input type="reset" value="重置" />
				</td>
			</table>
		</form>
	</body>
</html>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值