From 04ba73fb7acd19d6d0c71bb4d96d8af9950fb899 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 4 Nov 2015 10:19:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=8F=91=E5=B8=96=20?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 8314c3902..25a4fae46 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -58,15 +58,15 @@ if(!check_memo_name()){ return; } - if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.html().trim() != "" ){ + if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() ){ memo_content.sync(); $("#new_memo").submit(); - }else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.html().trim() == ""){ + }else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){ $("#error").html("主题和内容不能为空").show(); } - else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.html().trim() != "" ){ + else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){ $("#error").html("主题不能为空").show(); - }else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.html().val().trim() == ""){ + }else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.isEmpty()){ $("#error").html("内容不能为空").show(); } }