论坛编辑帖 的bug

This commit is contained in:
lizanle 2015-11-04 10:24:07 +08:00
parent 04ba73fb7a
commit ea6c4b09fe
1 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<script>
function check_and_submit(){
if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.html().trim() != "" ){
if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() ){
if($("textarea[name='memo[subject]']").val().trim().length > 50 ){
$("#error").html('主题不能超过50个字符').show();
return;
@ -13,11 +13,11 @@
// }
memo_content.sync();
$("#edit_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().trim() == ""){
}else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){
$("#error").html("主题和内容不能为空").show();
}
}