From e81d8f83a55358a4aa16456cff749ff0279b708f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 21 Sep 2015 16:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=20?= =?UTF-8?q?=E8=A6=81=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_forums.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index a03a23e7f..c4ece5269 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -60,11 +60,15 @@ function addTag(){ if(<%=@forum.creator.id == User.current.id%>) { - if ($("input[name='addTag']").val().trim() != "") { - $.get( - '<%= add_forum_tag_forum_path(@forum)%>' + "?tag_str=" + $("input[name='addTag']").val(), - {} - ); + if ($("input[name='addTag']").val().trim() != "" ) { + if($("input[name='addTag']").val().trim().length <= 20) { + $.get( + '<%= add_forum_tag_forum_path(@forum)%>' + "?tag_str=" + $("input[name='addTag']").val(), + {} + ); + }else{ + alert("标签名字长度不能超过20个字符"); + } } } }