1、新增http 格式校验
This commit is contained in:
@@ -199,7 +199,17 @@ jQuery.validator.addMethod("domainCheck",function(value, element) {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//http、https 格式校验
|
||||
jQuery.validator.addMethod("httpCheck",function(value, element) {
|
||||
var regexp=/^[hH][tT][tT][pP]([sS]?):\/\/(\S+\.)+\S{2,}$/;
|
||||
if(this.optional(element)||regexp.test(value)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//ip地址校验
|
||||
jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
var ipv4_ip_subnet_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\/(3[0-2]|[1-2][0-9]|[0-9])$/;
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
hexCheck:"Please enter the HEX format character",
|
||||
invisibleChar:"Please enter the visible character",
|
||||
hasInvisibleChar:"The tag {0} has invisible character",
|
||||
haveInvisibleChar:"The tags {0} have invisible character"
|
||||
haveInvisibleChar:"The tags {0} have invisible character",
|
||||
httpCheck:"Please enter a correct url(http[s]://xxx.xx)"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
hexCheck:"请输入十六进制字符",
|
||||
invisibleChar:"请输入可见字符",
|
||||
hasInvisibleChar:"标签{0}包含不可见字符",
|
||||
haveInvisibleChar:"标签{0}包含不可见字符"
|
||||
haveInvisibleChar:"标签{0}包含不可见字符",
|
||||
httpCheck:"请输入正确的url(http[s]://xxx.com)"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
Reference in New Issue
Block a user