$(function() {
$("#usersid").blur(
function() {
$("#usersid_msg").empty();
var name = $(this).val();
if (name == "" || name == null) {
$("#usersid").after("用户不能为空");
}
});
$("#articleid").blur(
function() {
$("#articleid_msg").empty();
var name = $(this).val();
if (name == "" || name == null) {
$("#articleid").after("新闻不能为空");
}
});
$("#contents").blur(
function() {
$("#contents_msg").empty();
var name = $(this).val();
if (name == "" || name == null) {
$("#contents").after("内容不能为空");
}
});
$('#sub').click(function(){
var usersid = $("#usersid").val();
var articleid = $("#articleid").val();
var contents = $("#contents").val();
$("#usersid_msg").empty();
$("#articleid_msg").empty();
$("#contents_msg").empty();
if (usersid == "" || usersid == null) {
$("#usersid").after("用户不能为空");
return false;
}
if (articleid == "" || articleid == null) {
$("#articleid").after("新闻不能为空");
return false;
}
if (contents == "" || contents == null) {
$("#contents").after("内容不能为空");
return false;
}
});
$('#res').click(function() {
$("#usersid_msg").empty();
$("#articleid_msg").empty();
$("#contents_msg").empty();
});
});