$(document).ready(function() {
    (因为是内容页面,所以id有变化)

    $('#btnSubmitMessage').click(function() {

        var txttile = $('#txtTitle').val();
        var txtcontent = $('#txtContent').val();

       

        if (txttile == "") {
            alert("留言的主题不能为空!");
            return false;
        }

        else if (txttile.length > 15) {
            alert("标题不能超过15个字哦!");
            return false;
        }
        else if (txtcontent == "") {
            alert("留言的内容不能为空!");
            return false;
        }
        else {
            // 清空

            $('#txtTitle').val("");
           $('#txtContent').val("");
            return true;
        }

    });

});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-12-21
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
猜你喜欢
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案