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

FCK如何实现只读功能啊?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
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('{=i_name}') ;<br> oFCKeditor.BasePath = '{=dirFCK}FCKeditor/';<br> oFCKeditor.ToolbarSet = 'Readonly';<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>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报