jQuery EasyUI API 中文文档 - ValidateBox验证框
用 $.fn.validatebox.defaults 重写了 defaults。
用法
<input id="vv" required="true" validType="email">
$('#vv').validatebox({
required:true
});
验证规则
验证规则是通过使用 required 和 validType 特性来定义的, 这里是已经实施的规则:
email:匹配 email 正则表达式规则
url:匹配 URL 正则表达式规则
length[0,100]:允许从 x 到 y 个字符
remote['http://.../action.do','paramName']:发送 ajax 请求来验证值,成功时返回 'true' 。
要自定义验证规则,重写 $.fn.validatebox.defaults.rules ,来定义一个验证函数和无效的信息。例如,定义一个 minLength 验证类型:
$.extend($.fn.validatebox.defaults.rules, {
minLength: {
validator: function(value, param){
return value.length >= param[0];
},
message: 'Please enter at least {0} characters.'
}
});
现在你可以使用这个 minLength 验证类型,去定义一个至少输入5个字符的输入框:
特性
名称 |
类型 |
说明 |
默认值 |
required |
boolean |
定义是否字段应被输入。 |
false |
validType |
string |
定义字段的验证类型,比如 email、url,等等。 |
null |
missingMessage |
string |
当文本框是空时出现的提示文字。 |
This field is required. |
invalidMessage |
string |
当文本框的内容无效时出现的提示文字。 |
null |
方法
名称 |
参数 |
说明 |
destroy |
none |
移除并且销毁这个组件。 |
validate |
none |
进行验证以判定文本框的内容是否有效。 |
isValid |
none |
调用 validate 方法并且返回验证结果,true 或者 false。 |
jQuery EasyUI API 中文文档 - ValidateBox验证框的更多相关文章
- jQuery EasyUI API 中文文档
http://www.cnblogs.com/Philoo/tag/jQuery/ 共2页: 1 2 下一页 jQuery EasyUI API 中文文档 - 树表格(TreeGrid) 风流涕淌 ...
- jQuery EasyUI API 中文文档 - ComboGrid 组合表格
jQuery EasyUI API 中文文档 - ComboGrid 组合表格,需要的朋友可以参考下. 扩展自 $.fn.combo.defaults 和 $.fn.datagrid.defaults ...
- jQuery EasyUI API 中文文档 - Panel面板
<html> <head> <title>布局管理器--控制面板</title> <script src="jquery-easyui/ ...
- jquery easyui 弹出消息框 (转载) jQuery EasyUI API 中文文档 - 消息框(Messager) http://www.cnblogs.com/hantianwei/archive/2012/03/19/2407113.html
<html> <head> <!-- 导入easyui插件的js和css样式; --> <link rel="stylesheet" ty ...
- jQuery EasyUI API 中文文档 - 分隔按钮(splitbutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 菜单按钮(menubutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 链接按钮(linkbutton)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 布局(Layout)
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- jQuery EasyUI API 中文文档 - 表单(form补充)
继承(表单验证) 第一个参数如果是true那么就算key相同也会接着追加,相反怎会覆盖 $.extend([bool],obj,obj1); var obj = {name:"zhangsa ...
随机推荐
- 生活就像测试, BUG会越来越少,生活会越来越好!
生活就像测试, BUG会越来越少,生活会越来越好!
- oracle11g 拆分字符串的详细技巧
转自:http://m.blog.csdn.net/article/details?id=51946573 <-->功能需求 有一个比较长的SQL语句,查询 ...
- Leetcode 270. Closest Binary Search Tree Value
Given a non-empty binary search tree and a target value, find the value in the BST that is closest t ...
- 【bzoj1082】 SCOI2005—栅栏
http://www.lydsy.com/JudgeOnline/problem.php?id=1082 (题目链接) 题意 给出m块木柴,以及n块木板,要求将m块木柴做木板,要求将木柴切割成与木板一 ...
- python deep copy and shallow copy
Python中对于对象的赋值都是引用,而不是拷贝对象(Assignment statements in Python do not copy objects, they create bindings ...
- NOIp 0910 爆零记
这套题是神犇chty出的. 刚拿到题的时候有点懵逼,因为按照一般的套路第一题都是一眼题,但是看到第一题后想了很多个算法和数据结构好像都不能很好的解决.然后就随手敲了个暴力去看T2. 嗯...文件名是b ...
- 使用BPEL创建Web服务组合
http://www.cnblogs.com/ahhuiyang/archive/2012/12/18/2824131.html 为简单起见,本例的Web服务组合只调用一个Web Service AP ...
- EasyUi 方法传递多个参数值得方法
1.项目中需要传递多个参数值 function actionFtt(value, row, index) { //传递查询需要的参数 var customerId = row.customerId;/ ...
- Ajax异步刷新,测试用户名是否被注册
<body> <form name="form_register"> <input type="> <input type=&q ...
- Linux中设置定期备份oracle数据库
昨天装好了oracle,今天尝试一下自动备份,我这两天装linux和oracle的目的就是这个. 如果是sql server,定期备份可以利用sql server的management studio来 ...