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(); } }