瀏覽代碼

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

和田中职
dyy 3 月之前
父節點
當前提交
f2af04347d
共有 3 個檔案被更改,包括 11 行新增2 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存