修改fck的文本编辑框为只读 我会带着你远行 2022-08-28 01:44 138阅读 0赞 最近在做一个项目,需要把fck的文本编辑框设置为只读状态,直接在html中的textarea设置“readonly”属性没有效果,需要在fck中设置,具体设置如下 1、在需要的页面代替用js替换掉你的textarea,如: window.onload = function() \{ var oFCKeditor = new FCKeditor('content'); oFCKeditor.BasePath= "/XiongFeng/fckeditor/"; oFCKeditor.Height= 380 ; oFCKeditor.Width= 800 ; //工具条集合的类型 oFCKeditor.ToolbarSet="Basic"; //oFCKeditor.Config\['CustomConfigurationsPath'\]="/MyFCK/myconfig/myconfig.js"; oFCKeditor.ReplaceTextarea(); \}; 3、替换掉之后这时需要添加下面的js代码 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(); \} 运行成功,编辑框也变为只读状态,但出现了,不能上传图片,我本来还打算用fck来弄一个上传图片的东西,看来还得想办法
还没有评论,来说两句吧...