<<How to disable FCKEditor?>>
I found two relevant threads (Thanks for the authors):
(1) To turn editing off use "document.frames[0].objContent.DOM.designMode = 'Off'".
To turn it back on use "document.frames[0].objContent.DOM.designMode = 'On'"
(2) var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oEditor.EditorDocument.body.disabled=true
I don't know where and how to implement (1) but I can implement (2) successfully. The editor is disabled with greyed out text and freezed scrollbar. However, this "disabled" effect is not what I expect. I want (i)the text remains its original colors, especially the background color is or close to grey, and (ii)the scrollbar is enabled for read-only. Please advise. Thanks a lot!
I found two relevant threads (Thanks for the authors):
(1) To turn editing off use "document.frames[0].objContent.DOM.designMode = 'Off'".
To turn it back on use "document.frames[0].objContent.DOM.designMode = 'On'"
(2) var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oEditor.EditorDocument.body.disabled=true
I don't know where and how to implement (1) but I can implement (2) successfully. The editor is disabled with greyed out text and freezed scrollbar. However, this "disabled" effect is not what I expect. I want (i)the text remains its original colors, especially the background color is or close to grey, and (ii)the scrollbar is enabled for read-only. Please advise. Thanks a lot!
RE: How to disable FCKEditor?
oFCKInstance.disabled = true;
This should be an approach to the common form controls (remember that "textarea" have also this R/W property).
Claudiu
RE: How to disable FCKEditor?
RE: How to disable FCKEditor?
Independant of this thread I have written a toggleFCKeditor function. It disables and re-enables the FCKeditor. When disbaled, the whole toolbar is grayed out and the editorArea will not receive any input. Optionally the toolbar can be hidden or collapsed. In this manner, when re-enabled, the toolbar will show again or be expanded.
Note: When disabled, the editorArea is also grayed out in IE.
So no boolean, but a toggle function.
I have created a new page for things like this: http://fcksnippets.saulmade.nl/ (alias of http://www.saulmade.nl/FCKeditor/FCKSnippets.php)
Here you can read more about the function, see a demo and get your download.
How to disable FCKEditor?
<script type="text/javascript">
function EditorReadOnly()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oEditor.EditorDocument.body.disabled=true ;
}
</script>
<body id="body" onload="EditorReadOnly()">
but it shows the javascript error ( EditorDocument.body is null or not an object).
can plz help how to get the fckeditor with read only ...
( i have used the fckeditor 2.4.1)
Thanks in Advance
Kohi
RE: How to disable FCKEditor?
As I wrote on my FCKSnippets page (http://www.saulmade.nl/FCKeditor/FCKSnippets.php):
When you want the FCKeditor to disable onload, use the FCKeditor_OnComplete API method:
function FCKeditor_OnComplete(editorInstance){toggleFCKeditor(editorInstance);}
See the wiki docs for more inforamtion: http://wiki.fckeditor.net/Developer%27s ... b159762430
Re: How to disable FCKEditor?
I installed the toggleFCKeditor snippet found on your homepage.
I am using the snippet function like this:
I have two radio buttons.
and my function:
When the From File radio button is clicked, the FCKeditor should be disabled and when the HTML radio button is clicked, the select element "blockfile" should be disabled.
As long as you click the right buttons in order, it is OK. But when clicked on an already-clicked radio button, it toggles the editor instance and for me the toggle part does not work as expected.
How can I make it work?
Re: How to disable FCKEditor?
you can use these lines any where not only in FCKeditor_OnComplete but you need get an instance of editor using javascript API for getting an instance of FCKeditor.
function FCKeditor_OnComplete( editorInstance )
{
// Just hiding the toolbar:
editorInstance.EditorWindow.parent.document.getElementById("xExpanded").style.display = "none";
// And hiding the small bar showing when the toolbar is collapsed is this:
editorInstance.EditorWindow.parent.document.getElementById("xCollapsed").style.display = "none";
// when you want to hide the collapse handle do:
editorInstance.EditorWindow.parent.document.getElementById("xCollapseHandle").style.display = "none";
// or hiding the expand handle. This seems to be the same as hiding the object with id 'xCollapsed' mentioned above:
editorInstance.EditorWindow.parent.document.getElementById("xExpandHandle").style.display = "none";
editorInstance.EditorDocument.body.contentEditable='false';
editorInstance.EditorDocument.designMode='off';
}
Re: How to disable FCKEditor?
Re: How to disable FCKEditor?
And here is one of the buttons which have IDs above...
Andrew Maisey