Просмотр исходного кода

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

和田中职
dyy 3 месяцев назад
Родитель
Сommit
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 {


Загрузка…
Отмена
Сохранить