1、新增http 格式校验
This commit is contained in:
@@ -119,7 +119,7 @@
|
|||||||
<label id="responseLabel" class="control-label col-md-3 "><font color="red">*</font>
|
<label id="responseLabel" class="control-label col-md-3 "><font color="red">*</font>
|
||||||
<spring:message code="redirect_url" /></label>
|
<spring:message code="redirect_url" /></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input id="responseContent" name="userRegion2" class="form-control required" type="text" value="${_cfg.userRegion2 }">
|
<input id="responseContent" name="userRegion2" class="form-control required httpCheck" type="text" value="${_cfg.userRegion2 }">
|
||||||
<select id="responseFile" name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
<select id="responseFile" name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
<c:forEach items="${allProxyFileStrategys}" var="file">
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
|||||||
@@ -200,6 +200,16 @@ jQuery.validator.addMethod("domainCheck",function(value, element) {
|
|||||||
return false;
|
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地址校验
|
//ip地址校验
|
||||||
jQuery.validator.addMethod("ipCheck",function(value, element) {
|
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])$/;
|
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",
|
hexCheck:"Please enter the HEX format character",
|
||||||
invisibleChar:"Please enter the visible character",
|
invisibleChar:"Please enter the visible character",
|
||||||
hasInvisibleChar:"The tag {0} has invisible 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));
|
}(jQuery));
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
hexCheck:"请输入十六进制字符",
|
hexCheck:"请输入十六进制字符",
|
||||||
invisibleChar:"请输入可见字符",
|
invisibleChar:"请输入可见字符",
|
||||||
hasInvisibleChar:"标签{0}包含不可见字符",
|
hasInvisibleChar:"标签{0}包含不可见字符",
|
||||||
haveInvisibleChar:"标签{0}包含不可见字符"
|
haveInvisibleChar:"标签{0}包含不可见字符",
|
||||||
|
httpCheck:"请输入正确的url(http[s]://xxx.com)"
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
|||||||
Reference in New Issue
Block a user