创建帖子的提示信息分开显示

This commit is contained in:
lizanle 2015-09-23 11:27:38 +08:00
parent 5ba889ecc1
commit d9c0809f53
1 changed files with 8 additions and 3 deletions

View File

@ -55,10 +55,15 @@
}); });
function check_and_submit(){ function check_and_submit(){
if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() != "" && check_memo_name()){ if(!check_memo_name()){
return;
}
if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() != "" ){
$("#new_memo").submit(); $("#new_memo").submit();
}else{ }else if($("textarea[name='memo[subject]']").val().trim() == "" && $("textarea[name='memo[content]']").val().trim() != "" ){
$("#error").html("主题和内容不能为空").show(); $("#error").html("主题不能为空").show();
}else if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() == ""){
$("#error").html("内容不能为空").show();
} }
} }