读书人

FCK 应验;FCK 验证非空

发布时间: 2012-11-06 14:07:00 作者: rapoo

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

<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"  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取值咯.
原来要这么取值,汗.

var content = FCKeditorAPI.GetInstance("article_content").GetXHTML(true);


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

读书人网 >Web前端

热点推荐