diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index ecce3c64b..ab78fb03c 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -280,9 +280,6 @@ public class BaseController { binder.registerCustomEditor(String.class, new PropertyEditorSupport() { @Override public void setAsText(String text) { - Pattern p = Pattern.compile("\t|\r|\n"); - Matcher m = p.matcher(text); - text = m.replaceAll(""); setValue(text == null ? null : StringEscapeUtils.escapeHtml4(text.trim())); } @Override diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 2945ce45a..4d9c161d7 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -173,6 +173,14 @@ jQuery.validator.addMethod("compareDate", function(value, element, param) { return true; }, "结束时间不能早于开始时间"); +jQuery.validator.addMethod("invisibleChar", function(value, element) { + var reg = new RegExp(/\t|\r|\n/); + if (value.match(reg)) { + return false; + } + return true; +}, "请输入可见字符"); + //掩码校验,超过两位不得以0开头 jQuery.validator.addMethod("notStartZero",function(value, element) { if(value.length>1&&value.length<6){ diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index 287e8ef0e..ec09225bc 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -61,6 +61,7 @@ checkParent:"Configuration Type must match it's parent.", specServiceCodeCheck:"Protocol No is repeat.", compareDate:"The end time should not be earlier than the start time.", - hexCheck:"Please enter the HEX format chatactar" + hexCheck:"Please enter the HEX format character", + invisibleChar:"Please enter the visible character" }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 64649ea22..aa2192fc3 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -59,6 +59,7 @@ checkParent:"Configuration Type must match it's parent.", specServiceCodeCheck:"Protocol No is repeat.", compareDate:"The end time should not be earlier than the start time.", - hexCheck:"Please enter the HEX format chatactar" + hexCheck:"Please enter the HEX format character", + invisibleChar:"Please enter the visible character" }); }(jQuery)); \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index 066213cc7..c68b5da79 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -63,6 +63,7 @@ checkParent:"配置类型必须与上级配置一致!", specServiceCodeCheck:"协议号重复", compareDate:"结束时间不能早于开始时间", - hexCheck:"请输入十六进制字符" + hexCheck:"请输入十六进制字符", + invisibleChar:"请输入可见字符" }); }(jQuery)); diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index ad826a9ff..f070da75a 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -407,6 +407,11 @@ $(function(){ form.submit(); } }); + $("#ipCfgFrom input, #cfgForm input").change(function(){ + var s = $(this).val(); + var ns = s.replace(/\t|\r|\n/mg, ""); + $(this).val(ns); + }); }); window.onload=function(){ //日志查询IP类型增加格式提示