<html><head>
<title>easyui表单验证的例子-www.jb200.com</title>
<link style="text/css" rel="stylesheet" href="/jquery-easyui-1.1.2/themes/default/easyui.css">
<script src="jquery-1.4.2.min.js"></script>
<script src="jquery.easyui.min.js"></script>
<script>
$.extend($.fn.validatebox.defaults.rules, {
minLength: {
validator: function(value, param){
return value.length >= param[0];
},
message: '请输入至少(2)个字符.'
}
});
</script>
</head>
<body>
jquery easyui 表单验证举例。www.jb200.com
<form name="frmRegister" method="post">
<div style="width:500px;height:20px;">
name:<input name="txtName" class="easyui-validatebox"validType="minLength[3]" missingMessage="不能为空" required="true" >
</div>
<div style="width:500px;height:20px;">
psw:<input name="txtPsw" type="password" class="easyui-validatebox" validType="minLength[2]" required="true">
</div>
<div style="width:500px;height:20px;">
address:<input name="txtAddr" class="easyui-validatebox" validType="minLength[4]" invalidMessage="请输入至少4个字符" required="true">
</div>
<div style="width:500px;height:20px;">
email:<input name="txtEmail" validType="email" class="easyui-validatebox">
</div>
<div style="width:500px;height:20px;">
<input type="submit" value="注册">
</div>
</form>
</body>
</html>