From 0ed26310e36a519ce8e4e953310ee041b445d606 Mon Sep 17 00:00:00 2001 From: liuyizhou Date: Tue, 21 Jun 2016 16:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E2=80=9C=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=E5=90=8D=E7=A7=B0=E5=B7=B2=E7=BB=8F=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E2=80=9D=EF=BC=8C=E5=AE=9E=E9=99=85=E5=8F=88=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E4=BA=86=20=E7=9A=84=E9=97=AE=E9=A2=98=20=20?= =?UTF-8?q?app/views/forums/index.html.erb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/index.html.erb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index c2997ac25..6c9428af3 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -28,6 +28,7 @@ } } $(function() { + hideError(); $("#complex").click(function(){ $("#reorder_popu").removeClass("sortArrowActiveU"); $("#reorder_popu").removeClass("sortArrowActiveD"); @@ -71,10 +72,11 @@ e.preventDefault(); } }) + }); function check_and_submit(doc){ - $("#error").html('').hide(); - check_forum_name(); + $("#error").html("").hide(); +// check_forum_name(); if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){ $("#error").html("名称不能为空").show(); return; @@ -91,17 +93,20 @@ } var check_pass = true; function check_forum_name(){ + $("#error").html("").hide(); check_pass = true; name = $("textarea[name='forum[name]']").val().trim(); + alert(name) if( name != ""){ $.get( '<%= check_forum_name_forums_path %>', {"forum_name":encodeURIComponent(name)}, function(data){ - + alert(data) if( data == 'true'){ $("#error").html("贴吧名称已经存在").show(); check_pass = false; + return false; } } );