From b50e6005da7472b71b85a760783c3747a599e6d3 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Thu, 13 Jun 2024 11:29:12 +0800 Subject: [PATCH] =?UTF-8?q?abc=E9=AA=8C=E8=AF=81=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BC=9A=E5=BD=B1=E5=93=8D=E7=A7=9F=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=9A=84=E4=BF=9D=E5=AD=98=EF=BC=8C=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0abc123=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/jquery-validation/1.16/jquery.validate.extend.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/static/src/main/resources/static/jquery-validation/1.16/jquery.validate.extend.js b/modules/static/src/main/resources/static/jquery-validation/1.16/jquery.validate.extend.js index ff15585f..d3370f7d 100644 --- a/modules/static/src/main/resources/static/jquery-validation/1.16/jquery.validate.extend.js +++ b/modules/static/src/main/resources/static/jquery-validation/1.16/jquery.validate.extend.js @@ -69,6 +69,11 @@ jQuery.validator.addMethod("realName", function(value, element) { // 数字字母验证 jQuery.validator.addMethod("abc",function(value, element) { + return this.optional(element) || /^[a-zA-Z0-9_]*$/.test(value); +}, $.validator.messages.abc); + +// 数字字母验证(以字母开头) +jQuery.validator.addMethod("abc123",function(value, element) { return this.optional(element) || /^[a-zA-Z][a-zA-Z0-9_]*$/.test(value); }, $.validator.messages.abc);