FCK 非空验证

项目中用了个FCK 文本编辑框
看起来简洁,用起来也还不错.

Java代码
  1. <script src="js/formValidator.js" type="text/javascript" charset="UTF-8"></script>   
  2. <script src="js/fckeditor.js" type="text/javascript" charset="UTF-8"></script>   
  3.   
  4.   
  5.   
  6. <textarea  rows="20" name="article.content"  class="input_text" id="article_content" style="width:600px;" ></textarea>   
  7.     <!--<fck:editor instanceName="article.content"    
  8.       height="400px" width="600px"></fck:editor>-->   
  9.          <script type="text/javascript">   
  10.              var oFCKeditor = new FCKeditor('article_content') ;   
  11.              oFCKeditor.BasePath = "fckeditor/" ;   
  12.              oFCKeditor.Height = 200;   
  13.              oFCKeditor.ToolbarSet = "My" ;   
  14.              oFCKeditor.EnterMode = "" ;     
  15.              oFCKeditor.ShiftEnterMode = "br" ;   
  16.              oFCKeditor.ReplaceTextarea();   
  17.             </script>  
<script src="js/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="js/fckeditor.js" type="text/javascript" charset="UTF-8"></script>



<textarea  rows="20" name="article.content"  class="input_text" id="article_content" style="width:600px;" ></textarea>
    <!--<fck:editor instanceName="article.content" 
      height="400px" width="600px"></fck:editor>-->
         <script type="text/javascript">
             var oFCKeditor = new FCKeditor('article_content') ;
             oFCKeditor.BasePath = "fckeditor/" ;
             oFCKeditor.Height = 200;
             oFCKeditor.ToolbarSet = "My" ;
             oFCKeditor.EnterMode = "" ;  
             oFCKeditor.ShiftEnterMode = "br" ;
             oFCKeditor.ReplaceTextarea();
            </script>



做非空和长度限制验证的时候 发现获得的aiticle_content对象的value总是处于初始化状态
不解.明明输入了很多值;怎么就不能验证了 想了想是不是JQuery的问题 或者浏览器的问题
写了个 document.getElementById("article_content").value;
居然也没值,汗..

弄了半天才想起来,呗FCK托管了嘛,当然是找FCK取值咯.
原来要这么取值,汗.

Java代码
  1. var content = FCKeditorAPI.GetInstance("article_content").GetXHTML(true);  
var content = FCKeditorAPI.GetInstance("article_content").GetXHTML(true);



ok 拿着content去验证呗,呵呵. 貌似小题大作了一番,没办法;刚自己居然被一个非空验证
弄啥了,汗......

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值