去掉重复的获取页面元素步骤
This commit is contained in:
@@ -170,13 +170,7 @@ jQuery.validator.addMethod("notStartZero",function(value, element) {
|
||||
jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
if(value.length==0||value.trim().length==0){return true;}
|
||||
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
|
||||
if(!typeInt){
|
||||
typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
|
||||
}
|
||||
var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
|
||||
if(!ipPattern){
|
||||
ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
|
||||
}
|
||||
if(typeInt==4){
|
||||
if(ipPattern){
|
||||
if(ipPattern==1){//ip/掩码格式
|
||||
@@ -292,9 +286,6 @@ jQuery.validator.addMethod("ipMask",function(value, element) {
|
||||
jQuery.validator.addMethod("portCheck",function(value, element) {
|
||||
if(value.length==0||value.trim().length==0){return true;}
|
||||
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='portPattern']").val();
|
||||
if(!typeInt){
|
||||
typeInt=$(element).parents(".row").parent(".row").find("select[name$='portPattern']").val();
|
||||
}
|
||||
if(typeInt==1){//port 0~65535
|
||||
if(this.optional(element)||(/^(0|[1-9][0-9]{0,4})$/.test(value)&& RegExp.$1 <=65535)){
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user