<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<!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=GBK">
<title>表单验证类</title>
</head>
<body>
<style>
body,td{font:normal 12px Verdana;color:#333333}
input,textarea,select,td{font:normal 12px Verdana;color:#333333;border:1px solid #999999;background:#ffffff}
table{border-collapse:collapse;}
td{padding:3px}
input{height:20;}
textarea{width:80%;height:50px;overfmin:auto;}
form{display:inline}
</style>
<script src="/tt/JavaScript/vli.js" language="javascript"></script>
<form name="frm" id="frm" action="" method="post" onSubmit="return Validator.Validate(this,2)">
<table align="center">
<tr>
<td>真实姓名:</td><td><input name="CName" id="CName" dataType="Chinese" msg="真实姓名只允许中文"></td>
</tr>
<tr>
<td>英文名:</td><td><input name="Nick" dataType="English" require="false" msg="英文名只允许英文字母"></td>
</tr>
<tr>
<td>不能为空:</td><td><input name="EName" id="EName" dataType="Notnull" msg="不允许为空" ></td>
</tr>
<tr>
<td>主页:</td><td><input name="Homepage" id="Homepage" require="false" dataType="Url" msg="非法的Url"></td>
</tr>
<tr>
<td>密码:</td><td><input name="Password" id="Password" dataType="Notnull" require="false" msg="密码不允许为空" type="password"></td>
</tr>
<tr>
<td>重复:</td><td><input name="Repeat" id="Repeat" dataType="Repeat" to="Password" msg="两次输入的密码不一致" type="password"></td>
</tr>
<tr>
<td>信箱:</td><td><input name="Email" id="Email" dataType="Email" msg="信箱格式不正确"></td>
</tr>
<tr>
<td>信箱:</td><td><input name="Email" id="Email" dataType="Repeat" to="Email" msg="两次输入的信箱不一致"></td>
</tr>
<tr>
<td>QQ:</td><td><input name="QQ" id="QQ" require="false" dataType="QQ" msg="QQ号码不存在"></td>
</tr>
<tr>
<td>身份证:</td><td><input name="Card" id="Card" dataType="IdCard" msg="身份证号码不正确"></td>
</tr>
<tr>
<td>年龄:</td><td><input name="Age" id="Age" dataType="Range" msg="年龄必须在18~28之间" min="18" max="28"></td>
</tr>
<tr>
<td>年龄1:</td><td><input name="Age1" id="Age1" require="false" dataType="Compare" msg="年龄必须在18以上" to="18" operator="GreaterThanEqual"></td>
</tr>
<tr>
<td>电话:</td><td><input name="Phone" id="Phone" require="false" dataType="Phone" msg="电话号码不正确"></td>
</tr>
<tr>
<td>手机:</td><td><input name="Mobile" id="Mobile" require="false" dataType="Mobile" msg="手机号码不正确"></td>
</tr>
<tr>
<td>生日:</td><td><input name="Birthday" id="Birthday" dataType="Date" format="ymd" msg="日期格式不正确,应为年-月-日格式"></td>
</tr>
<tr>
<td>比生日早:</td><td><input name="Birthday1" id="Birthday1" dataType="DateCompare" msg="必须比生日日期早" msg1="必须比生日日期早" to="Birthday" operator="GreaterThan"></td>
</tr>
<tr>
<td>比生日晚:</td><td><input name="Birthday2" id="Birthday2" dataType="DateCompare" msg="必须比生日日期晚" msg1="必须比生日日期晚" to="Birthday" operator="LessThan"></td>
</tr>
<tr>
<td>操作系统:</td><td><select name="Operation" dataType="Require" msg="未选择所用操作系统" ><option value="">选择您所用的操作系统</option><option value="Win98">Win98</option><option value="Win2k">Win2k</option><option value="WinXP">WinXP</option></select></td>
</tr>
<tr>
<td>所在省份:</td><td>广东<input name="Province" value="1" type="radio">陕西<input name="Province" value="2" type="radio">浙江<input name="Province" value="3" type="radio">江西<input name="Province" value="4" type="radio" dataType="Group" msg="必须选定一个省份" ></td>
</tr>
<tr>
<td>爱好:</td><td>运动<input name="Favorite" value="1" type="checkbox">上网<input name="Favorite" value="2" type="checkbox">听音乐<input name="Favorite" value="3" type="checkbox">看书<input name="Favorite" value="4" type="checkbox"" dataType="Group" min="2" max="3" msg="必须选择2~3种爱好"></td>
</tr>
<tr>
<td>自我介绍:</td><td><textarea name="Description" dataType="Limit" max="10" msg="自我介绍内容必须在10个字之内">中文是一个字</textarea></td>
</tr>
<tr>
<td>自传:</td><td><textarea name="History" dataType="LimitB" min="3" max="10" msg="自传内容必须在[3,10]个字节之内">中文是两个字节t</textarea></td>
</tr>
<tr>
<td colspan="2">
<input name="Submit" type="submit" value="确定提交">
<input onClick="Validator.Validate(document.getElementById('frm'),3)" value="检验模式3" type="button"></td>
</tr>
</table>
</form>
</body>
</html>