From e6ce55b15a339d059dc9e7a7b9de428e5d61d46f Mon Sep 17 00:00:00 2001 From: wangxin Date: Fri, 31 Aug 2018 16:12:24 +0800 Subject: [PATCH] =?UTF-8?q?input=20textarea=20on=20blur=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E9=A6=96=E5=B0=BE=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/global/scripts/common.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index dec0bfd5b..6bda5a5b4 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -433,6 +433,11 @@ $(function(){ return false; }); initCommIpVal(); + //去掉首尾空格 + $("input,textarea").on("blur",function(){ + var val=$(this).val(); + $(this).val(val.trim()); + }); }); window.onload=function(){ // 配置id的搜索下拉框选择切换