From 9d6263a9d18fefbb070a8e467ed84c3d98cfa44b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Sep 2015 09:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=92=8C=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=BA=94=E8=AF=A5=E5=88=86=E5=BC=80=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/index.html.erb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 429be7ff0..09755a80a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -68,10 +68,17 @@ function check_and_submit(doc){ $("#error").html('').hide(); check_forum_name(); - if( $("textarea[name='forum[name]']").val().trim() == "" || $("textarea[name='forum[description]']").val().trim() == "" ){ - $("#error").html("名称和描述未填写正确").show(); + if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){ + $("#error").html("名称不能为空").show(); return; - }else{ + } else if( $("textarea[name='forum[description]']").val().trim() == "" && $("textarea[name='forum[name]']").val().trim() != "" ){ + $("#error").html("描述不能为空").show(); + return; + }else if($("textarea[name='forum[description]']").val().trim() == "" && $("textarea[name='forum[name]']").val().trim() == ""){ + $("#error").html("名称和描述不能为空").show(); + return; + } + else{ doc.parent().parent().submit(); } }