shijing19850510 2009-06-25 18:33
浏览 212
已采纳

FCK如何实现只读功能啊?

我在jsp文件中引入了fck控件,但是现在我想让这个textarea呈现灰色不可编辑状态,我在textarea里面加入了disabled属性没有反应,照样可以编辑,是什么错误呢?麻烦帮忙解决一下,谢谢,呵呵~~
下面是我的代码:

window.onload=function(){ var oFCKeditor=new FCKeditor("Fckeditor1"); oFCKeditor.BasePath="fckeditor/"; oFCKeditor.Width="75%"; oFCKeditor.Height="400"; oFCKeditor.ReplaceTextarea(); document.getElementById('newsContent').disabled=true; }

  • 写回答

3条回答 默认 最新

  • A丢丢设计 2009-07-09 12:25
    关注

    编辑 \fckeditor\ 目录下的 fckconfig.js ,加一个toolbar:

    FCKConfig.ToolbarSets["Readonly"] = [
    ['Preview','Print']
    ] ;

    在使用fckeditor的页面中,加入如下js代码

    <br> window.onload = function()<br> {<br> var oFCKeditor = new FCKeditor(&#39;{=i_name}&#39;) ;<br> oFCKeditor.BasePath = &#39;{=dirFCK}FCKeditor/&#39;;<br> oFCKeditor.ToolbarSet = &#39;Readonly&#39;;<br> oFCKeditor.Height = 500;<br> oFCKeditor.ReplaceTextarea();<br> };</p> <pre><code> function FCKeditor_OnComplete( editor ) { editor.EditorDocument.body.contentEditable = false; editor.EditMode=FCK_EDITMODE_SOURCE; editor.ToolbarSet.RefreshModeState(); editor.EditMode=FCK_EDITMODE_WYSIWYG; editor.ToolbarSet.RefreshModeState(); } </code></pre> <p>

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码