40 lines
876 B
JavaScript
40 lines
876 B
JavaScript
/**
|
|
* Created by ouyangxuhua on 2015/12/30.
|
|
*/
|
|
function submit_topic()
|
|
{
|
|
if(regexTopicSubject() && regexTopicDescription())
|
|
{
|
|
message_content_editor.sync();
|
|
$("#message-form").submit();
|
|
}
|
|
}
|
|
|
|
function regexTopicSubject() {
|
|
var name = $("#message_subject").val();
|
|
if(name.length ==0)
|
|
{
|
|
$("#subjectmsg").text("标题不能为空");
|
|
$("#subjectmsg").css('color','#ff0000');
|
|
$("#message_subject").focus();
|
|
return false;
|
|
}
|
|
else if(name.length <= 255)
|
|
{
|
|
$("#subjectmsg").text("填写正确");
|
|
$("#subjectmsg").css('color','#008000');
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
$("#subjectmsg").text("标题超过255个字符");
|
|
$("#subjectmsg").css('color','#ff0000');
|
|
$("#message_subject").focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function reset_topic(){
|
|
|
|
}
|