How do I set the innerhtml of the editor?
I retrieve html from a database and need to display the text in the editor.
Setting the .Value property of the editor displays the html elements.
I retrieve html from a database and need to display the text in the editor.
Setting the .Value property of the editor displays the html elements.
RE: Set innerhtml of FCKEditor
You'll probably want to have a look at http://wiki.fckeditor.net/Developer%27s ... script_API : SetHTML( html );
RE: Set innerhtml of FCKEditor
RE: Set innerhtml of FCKEditor
In some cases this is text that has been saved from the editor.
It has html tags e.g. <p>This text </p> . I may need to redisplay this to
the user in the Editor if they want to change it. However I do
not want to display <p>This text </p> . I want to set the 'Source'
of the editor to <p>This text </p> so in normal mode it will just
appear as 'This text'.
Is there a way to do this in the code behind?
RE: Set innerhtml of FCKEditor
I've got the same problem here. I do not want to set the html contents of the editor, but the source.
So if I'm setting the source to "<p>this text</p>" it will display "this text" in normal mode, but "<p>this text</p>" in source view mode.
Thanks and bye
m;
RE: Set innerhtml of FCKEditor
RE: Set innerhtml of FCKEditor
Hi there again
, it should be
I think I found the solution to the problem (or at least the cause of it).
I'm trying to set the contents of the editor with
oEditor.SetHTML(document.getElementById('text').innerHTML);
where 'text' is a textarea
<textarea id="text"><p>this text</p></textarea>
which of course is not correct
<textarea id="text"><p>this text</p></textarea>
If I use an alert to display the contents of this textarea, that's exacly what I get
alert(document.getElementById('text').innerHTML);
===> <p>this text</p>
Therefore I somehow have to convert > < and probably & before inserting them into the editor.