From 2e19ab7ce677120fc46cacb10da6659e805e03c0 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Mon, 4 Jun 2018 10:21:44 +0800 Subject: [PATCH] =?UTF-8?q?HTTP=E5=92=8CSSL=E9=85=8D=E7=BD=AE=E4=B8=BB?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E4=BD=BF?= =?UTF-8?q?=E7=94=A8tags=E7=9A=84=E5=85=B3=E9=94=AE=E5=AD=97=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/cfg/website/httpForm.jsp | 42 ++++++++++++++----- .../WEB-INF/views/cfg/website/sslForm.jsp | 27 +++++++++--- .../static/global/scripts/jquery.tagsinput.js | 2 +- 3 files changed, 53 insertions(+), 18 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp index 74774771d..1699c4bcf 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpForm.jsp @@ -41,14 +41,20 @@ $("#cfgFrom").validate( { errorPlacement : function(error, element) { - $(element).parents(".form-group").find( - "div[for='" - + element.attr("name") - + "']").append(error); + if($(element).parents().hasClass("tagsinput")){ + $(element).parents(".col-md-6").next("div").append(error); + }else{ + $(element).parents(".form-group").find( + "div[for='" + + element.attr("name") + + "']").append(error); + } }, submitHandler : function(form) { //loading('onloading...'); //代表所有业务都隐藏了,提示必须增加一种业务数据 + var flag = true; + //代表所有业务都隐藏了,提示必须增加一种业务数据 if($(".boxSolid").length ==$(".boxSolid.hidden").length){ top.$.jBox.tip("", ""); return; @@ -60,12 +66,25 @@ top.$.jBox.tip("", ""); return; } - //将disable属性的元素删除 - $(".disabled").each(function(){ - $(this).remove(); - }); - $("input[name$='exprType']").attr("disabled",false); - form.submit(); + $(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){ + if($(this).val()==''){ + $(this).parents(".form-group").find( + "div[for='" + + $(this).attr("name") + + "']").html(""); + flag = false; + return; + } + }) + if(flag){ + //将disable属性的元素删除 + $(".disabled").each(function(){ + $(this).remove(); + }); + $("input[name$='exprType']").attr("disabled",false); + form.submit(); + } + }, errorContainer : "#messageBox", }); @@ -97,6 +116,7 @@ +
@@ -151,7 +171,7 @@
-
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp index d4268ce16..7363e130e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp @@ -32,6 +32,7 @@ }, submitHandler : function(form) { //loading('onloading...'); + var flag = true; //代表所有业务都隐藏了,提示必须增加一种业务数据 if($(".boxSolid").length ==$(".boxSolid.hidden").length){ top.$.jBox.tip("", ""); @@ -44,12 +45,25 @@ top.$.jBox.tip("", ""); return; } - //将disable属性的元素删除 - $(".disabled").each(function(){ - $(this).remove(); - }); - $("input[name$='exprType']").attr("disabled",false); - form.submit(); + $(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){ + if($(this).val()==''){ + $(this).parents(".form-group").find( + "div[for='" + + $(this).attr("name") + + "']").html(""); + flag = false; + return; + } + }) + if(flag){ + //将disable属性的元素删除 + $(".disabled").each(function(){ + $(this).remove(); + }); + $("input[name$='exprType']").attr("disabled",false); + form.submit(); + } + }, errorContainer : "#messageBox", }); @@ -82,6 +96,7 @@ +
diff --git a/src/main/webapp/static/global/scripts/jquery.tagsinput.js b/src/main/webapp/static/global/scripts/jquery.tagsinput.js index af3319997..6b9f47cd1 100644 --- a/src/main/webapp/static/global/scripts/jquery.tagsinput.js +++ b/src/main/webapp/static/global/scripts/jquery.tagsinput.js @@ -223,7 +223,7 @@ if (settings.interactive) { - markup = markup + ''; + markup = markup + ''; } markup = markup + '
';