ixx
ixx

Reputation: 32273

Readonly FCKEditor

Just to clarify: It means text input must not be possible.

I have tried a lot of things I found in internet but nothing works:

var iframe = document.getElementById('fckFrame');
var doc = iframe.contentDocument || iframe.contentWindow.document;
doc.body.setAttribute('contenteditable', false);
doc.body.contentEditable='false'; 
doc.designMode='off';
doc.body.disabled=true;

This is executed, it finds everything and throws no errors, but I'm still able to type text in the editor :/

I tried putting the code once in function FCKeditor_OnComplete( editorInstance ) {} in my HTML page, and also in fckeditor.js in a function I call after the editor was created. Both cases run without problems, but I still can type.

I also put attributes contenteditable="false" disabled="true" in body tag of the editor's iframe using firebug. But no effect, i still can type.

I even found this demo, which if I'm not understanding wrong claims to make readonly work, but I can also type there

http://www.saulmade.nl/FCKeditor/FCKSnippets.php#demoAnchor

I'm using the last version of FCKEditor (FCKeditor 2.6.6) and can't change it.

Any kind of solution - official, workaround or tricks are welcome as long as it works!

Thanks

Upvotes: 2

Views: 1427

Answers (1)

Ben Parsons
Ben Parsons

Reputation: 1443

Seems like the information on this question would solve your problem if you're happy to use a server-side solution.

It basically says to swap out the control on the server-side and use the content in the new control.

Upvotes: 1

Related Questions