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])$/;
|
||||
|
||||
Reference in New Issue
Block a user