zoukankan      html  css  js  c++  java
  • js dongtai xianshi textarea zishu

    <form name="FORM" id="FORM" method="post" action="?action=$atc"  enctype="multipart/form-data" onsubmit="return CheckForm();">

    <textarea name='postdb[content]' id='atc_content' style='700px;height:392px;;' onkeyup="checkLength();">$rsdb[content]</textarea>

    <br/>
    已输入字数:<span id="zs" style="color:Red;">0</span> (内容一定要丰富,充实,一般在8000字以上时,收录 和 排名 效果才会很好,里面内容请勿 重复、堆叠!)
    <br/>
    <span style="color:#CC6600"></span><font color='red' id="show_word"></font>


    <SCRIPT LANGUAGE="JavaScript">
       // 多个敏感词,这里直接以数组的形式展示出来
       var arrMg = ["fuck", "tmd", "他妈的", "按摩"];
     
    </SCRIPT>
     
    <SCRIPT LANGUAGE="JavaScript">
              
              
        function Trim(str,is_global)
            {
                var result;
                result = str.replace(/(^s+)|(s+$)/g,"");
                if(is_global.toLowerCase()=="g")
                {
                    result = result.replace(/s/g,"");
                 }
                return result;
          }
     
     
    function CheckForm(){
           //检测内容里是否有敏感词
              var inputContent = Trim($('#atc_title').val().toLowerCase()+$('#atc_keywords').val().toLowerCase()+$('#atc_content').val().toLowerCase(),"g");
              var showContent="";
           for (var i = 0; i < arrMg.length; i++) {
                if(inputContent.indexOf(arrMg[i]) > 0){
                    showContent =showContent+arrMg[i]+", ";
                     }
                    }
          if(showContent.length>0){
               alert("发现 敏感词!");
               $('#show_word').html("发现敏感词:"+showContent.toString());
               return false;
            }
     
         //检测内容是否超过5000字
         if($('#atc_content').val().length<2000){
                 var truthBeTold = window.confirm("信息内容 过少,为了你的信息能 获得好的 收录 和 排名,强烈建议增加 内容,最好 超过5000字 !\n\n内容一定要丰富,充实,一般在5000字以上时,收录 和 排名 效果才会很好,内容请勿 重复、堆叠!\n\n\n\n\n\n单击“确定”继续发布。单击“取消”返回增加内容。");
                 if (truthBeTold) {
                  
                   } else {return false;}
               }
         
     
     
      
       }
     
     
     
    function checkLength() {
            var curr =  $('#atc_content').val().length; //当前输入的
            $('#zs').html(curr.toString());
    }
     
    </SCRIPT>
    

      

  • 相关阅读:
    kbmmw 5.14.00 发布
    关于C++ auto使用要注意的一点
    git设置socks5代理
    电子书分享网站
    spring cache相关
    intellij idea开启debug热加载/热部署
    git 多次commit合并成一次提交
    es feature一览
    数据中台
    Java Agent
  • 原文地址:https://www.cnblogs.com/chenjian/p/6713267.html
Copyright © 2011-2022 走看看