<html>
<head>
<title> 表单特效 </title>
<script language="javascript">
function domTest(){
var username = document.getElementById("un").value;
var password = document.getElementById("pw").value;
var rpassword = document.getElementById("rpw").value;
var year= document.getElementById("yy").value;
var month= document.getElementById("mm").value;
var day= document.getElementById("dd").value;
var email= document.getElementById("em").value;
var yes= document.getElementById("yes");
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
if(username.length>=30||username.length==0){
alert("用户名格式不正确");
}
if(password.length==0||(isNaN(new Number(password))==true)){
alert("密码格式不正确");
}
if(rpassword.length==0||(isNaN(new Number(rpassword))==true)){
alert("再次输入的密码格式不正确");
}
if((isNaN(new Number(year))==true)||(isNaN(new Number(month))==true)||(isNaN(new Number(day))==true)){
alert("日期必须是数字");
}
if(month<1||month>12){
alert("月输入不正确");
}
if(day<1||day>12){
alert("日输入不正确");
}
if(pattern.test(email)==false){
alert("邮箱格式不正确");
}
}
function able(){
var submit= document.getElementById("sub");
submit.disabled=false;
}
function op(){
window.open("会员协议.htm");
}
function reset(){
location.reload();
}
</script>
</head>
<body>
<form name="registform" action="#" method="post" enctype="multipart/form-data">
<table>
<tr>
<tr>
<td>用户名:</td>
<td><input type="text"id="un" name="username" size="20" ></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password"id="pw" name="pwd"size="21"></td>
</tr>
<tr>
<td>再次输入密码:</td>
<td><input type="password"id="rpw" name="pwd"size="21"></td>
</tr>
<tr>
<td>性别:</td>
<td><input type="radio" name="sex" value="1"checked>男
<input type="radio" name="sex" value="0" >女</td>
</tr>
<tr>
<td>出生日期:</td>
<td><input type="text" id="yy" name="year"size="4">年
<input type="text"id="mm" name="month"size="2">月
<input type="text" id="dd" name="day"size="2">日</td>
</tr>
<tr>
<td>电子邮箱:</td>
<td><input type="text" id="em" name="day"size="20"></td>
</tr>
<td></td>
<td><input type="checkbox" id="yes" name="OK" onclick="able()">我同意遵守<input type="button" value="会员协议" onclick="op()"></td>
</tr>
</tr>
<tr>
<td></td>
<td><input type="button" id="sub" value="注册"disabled="true"onclick="domTest()"><input type="button" value="重填"onclick="reset()"></td>
<tr>
<table>
</form>
</body>
</html>
Html.rar_表格网页
版权申诉
109 浏览量
2022-09-21
08:30:45
上传
评论
收藏 1KB RAR 举报
![avatar](https://profile-avatar.csdnimg.cn/d600a32f29294db1a3be82ec9708491a_weixin_42651887.jpg!1)
weixin_42651887
- 粉丝: 83
- 资源: 1万+
最新资源
- C语言编程经典案例900集
- 实现求后缀表达式和对后缀表达式求值.zip
- MyEMS 一款功能强大的开源能源管理系统致力于实现对电水气等能源数据的全面采集分析和报表展示
- 毕设项目:网上图书销售管理系统(ASP+ACCESS+源代码+论文)
- Max30102实战开源资料集:硬件设计、上下位机程序及结构设计一应俱全
- PHP5版本手册chm格式压缩包
- Java微信公众号开发所需JAR包概述: Wx-tools框架JAR包:提供基于微信公众平台API的轻量级开发框架 相关依赖库
- duilib集成的Webkit内核浏览器控件 基于BlaFans的wke内核 提供丰富的浏览功能和稳定性 支持最新的HTML
- linux平台上的一种压力测试工具http-load压缩包
- 系统栏着色管理器:Syst
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)