Browse Source

【修改】表单验证增加最小位数字符串验证;

和田中职
dyy 3 months ago
parent
commit
f2af04347d
3 changed files with 11 additions and 2 deletions
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js
  2. +9
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js View File

@@ -150,7 +150,7 @@
}
}
var r = { code: true, msg: '' };
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') {
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull' || checkexpession == 'MinLenStr') {
var len = $this.attr("length");
r = checkfn(value, len);
} else {


+ 9
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js View File

@@ -202,6 +202,15 @@
res.msg = '必须小于等于' + n + '位字符或空';
}
return res;
},
isMinLenStr: function (obj, n) {//验证是否大于等于n位数的字符串 nchar
var res = { code: true, msg: '' };
obj = $.trim(obj);
if (!learun.validator.isNotNull(obj).code || obj.length < n) {
res.code = false;
res.msg = '必须大于等于' + n + '位字符';
}
return res;
}
};



+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js View File

@@ -88,7 +88,7 @@
// value = $this.val();
//}
var r = { code: true, msg: '' };
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') {
if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull' || checkexpession == 'MinLenStr') {
var len = $this.attr("length");
r = checkfn(value, len);
} else {


Loading…
Cancel
Save