WebMisSharp,WebMisCentral,企业框架正则表达式规则共享专版
2020-11-24 03:22
标签:style blog class code java ext ElegantWM.WebUI/Application/common/src/Tools.js 欢迎大家贡献更多的正则验证规则,目前支持如下: WebMisSharp,WebMisCentral,企业框架正则表达式规则共享专版,搜素材,soscw.com WebMisSharp,WebMisCentral,企业框架正则表达式规则共享专版 标签:style blog class code java ext 原文地址:http://www.cnblogs.com/qidian10/p/3703602.html/*****************************************************************/
/* VType自定义校验 */
/*****************************************************************/
Ext.apply(Ext.form.VTypes, {
number: function (val, field) {
return /^\d+$/.test(val);
},
numberText: ‘只能输入数字‘,
mobilephone: function (val, field) {
return /^1[3|4|5|6|7|8|9][0-9]{1}[0-9]{8}$/.test(val);
},
mobilephoneText: ‘手机号码格式错误‘,
postcode: function (val, field) {
return /^[1-9]\d{5}$/.test(val);
},
postcodeText: ‘邮政编码格式错误‘,
idnum: function (val, field) {
return /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/.test(val);
},
idnumText: ‘身份证格式错误‘,
ipaddress: function (val, field) {
return /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(val);
},
ipaddressText: ‘IP地址格式错误‘,
amount: function (val, field) {
return /^(([1-9]\d*)|\d)(\.\d{1,2})?$/.test(val);
},
amountText: ‘金额格式错误‘,
passwordConfirm: function (value, field) {
if (!(field.confirmTo instanceof Ext.form.Field)) {
field.confirmTo = Ext.getCmp(field.confirmTo);
}
return (value == field.confirmTo.getValue());
},
passwordConfirmText: ‘两次新密码输入不一致‘
});
文章标题:WebMisSharp,WebMisCentral,企业框架正则表达式规则共享专版
文章链接:http://soscw.com/index.php/essay/22308.html