<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>验证客户表单</title>
<link href="style/xfcss01.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!=""
{
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnvalue = (errors == '');
}
//-->
</script>
<link href="style/liuyanban.css" rel="stylesheet" type="text/css">
<link href="style/xbx1.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center" class="xinwen">验证客户表单</div></td>
</tr>
<tr>
<td><form name="form1" method="get" action="index.htm">
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="right">姓名</div></td>
<td><input name="name" type="text" id="name" onChange="MM_validateForm('name','','R');return document.MM_returnvalue" size="20" maxlength="18">
*</td>
</tr>
<tr>
<td><div align="right">密码</div></td>
<td><input name="password" type="password" id="password" onChange="MM_validateForm('password','','R');return document.MM_returnvalue" size="8">
*</td>
</tr>
<tr>
<td><div align="right">出生日期</div></td>
<td><input name="textfield" type="text" onChange="MM_validateForm('textfield','','RinRange1900:2010');return document.MM_returnvalue" size="8" maxlength="6">
年
<select name="Month" size="1" id="Month">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
月
<select name="select" size="1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="28">27</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
日*</td>
</tr>
<tr>
<td><div align="right">性别</div></td>
<td><input type="radio" name="sex" value="male">
男
<input name="sex" type="radio" value="female" checked>
女</td>
</tr>
<tr>
<td><div align="right">兴趣爱好</div></td>
<td><input name="interest" type="checkbox" id="interest" value="computer">
电影
<input name="interest" type="checkbox" id="interest" value="miuc">
音乐
<input name="interest" type="checkbox" id="interest" value="diannao">
电脑</td>
</tr>
<tr>
<td> </td>
<td><input name="interest" type="checkbox" id="interest" value="lvyou">
旅游
<input name="interest" type="checkbox" id="interest" value="jiyou">
集邮</td>
</tr>
<tr>
<td><input name="Submit" type="submit" onClick="MM_validateForm('name','','R','textfield','','RinRange1:2003','password','','RisNum');return document.MM_returnvalue" value="提交"></td>
<td><input name="Submit" type="reset" value="重置"></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
图片如下: