ソースを参照

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

和田中职
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: '' }; 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"); var len = $this.attr("length");
r = checkfn(value, len); r = checkfn(value, len);
} else { } 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 + '位字符或空'; res.msg = '必须小于等于' + n + '位字符或空';
} }
return res; 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(); // value = $this.val();
//} //}
var r = { code: true, msg: '' }; 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"); var len = $this.attr("length");
r = checkfn(value, len); r = checkfn(value, len);
} else { } else {


読み込み中…
キャンセル
保存