From cddb3deb3569d0d6a6b2cc697ac9a4590e198004 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 19 Sep 2015 13:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E4=B8=8D=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E6=88=90=E5=8A=9F=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E4=B9=9F=E6=B2=A1=E6=9C=89=E7=BB=99=E5=87=BA=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/index.html.erb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 75d6db2c8..e42334286 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -49,12 +49,9 @@ }); }); function check_and_submit(doc){ - $("#error").hide(); - if( check_pass == false){ - $("#error").html("贴吧名称已经存在").show(); - return; - } - if( $("input[name='forum[name]']").val().trim == "" || $("input[name='forum[description]']").val().trim == "" || check_pass == false){ + $("#error").html('').hide(); + check_forum_name(); + if( $("input[name='forum[name]']").val().trim() == "" || $("input[name='forum[description]']").val().trim() == "" ){ $("#error").html("名称和描述未填写正确").show(); return; }else{ @@ -63,6 +60,7 @@ } var check_pass = true; function check_forum_name(){ + check_pass = true; name = $("input[name='forum[name]']").val().trim(); if( name != ""){ $.get(