<<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?
http://fcksnippets.saulmade.nl/http://www.saulmade.nl/FCKeditor/FCKSnippets.php
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?
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:
function toggleBlockType(value) { var oEditor = FCKeditorAPI.GetInstance('ta1'); if(value == 0) { document.forms.AddBlock.blockfile.disabled = false; toggleFCKeditor(FCKeditorAPI.GetInstance('ta1')); } if(value == 1) { document.forms.AddBlock.blockfile.disabled = true; toggleFCKeditor(FCKeditorAPI.GetInstance('ta1')); } }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?
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %> <script type="text/javascript"> { // Special FCK Editor disable & control script. function FCKeditor_OnComplete(editorInstance) { // editorInstance.BasePath = "/UserControls/fckeditor/"; - Note the path is now supplied in the HTML. - alert(editorInstance.Name); if ((editorInstance.Name == "ReferralForm_ReferralFormReferral_ViewReferral_FCKEditorManagerNotesItem") || (editorInstance.Name == "ReferralForm_ReferralFormReferral_ViewReferral_FCKEditorNotesItem")) { // Diable toolbar. editorInstance.EditorDocument.body.disabled = true; // Diable buttons. editorInstance.EditorWindow.parent.FCK.ToolbarSet.Disable(); editorInstance.EditorWindow.parent.document.getElementById("xExpanded").style.display = "none"; } } } </script>And here is one of the buttons which have IDs above...
<FCKeditorV2:FCKeditor ID="FCKEditorNotesItem" runat="server" BasePath="~/UserControls/fckeditor/" ToolbarSet="MySet" Width="90%" Value='<%# Bind("Notes") %>' ></FCKeditorV2:FCKeditor>Andrew Maisey