I’m using HTMLBox to create a rich text editor on a settings page. When HTMLBox fires, it grabs the content of a textarea, hides the textarea with an editable div, then drops the content into that div. When you switch back to the ‘plain HTML’ display, it grabs the content from that div, drops it back into the textarea, and hides the div. This allows you to switch between wysiwyg and plain HTML.
I tested in Firefox, Chrome and Opera, and those all work fine, but I’m having a problem with Internet Explorer (surprise!). When you switch to basic HTML in IE, it still transfers the content, but the textarea displays the formatted text, rather than plain html. So if the wysiwyg editor creates something like
<font color="green">Green Text</font>
the basic textarea displays “green text” in green, instead of displaying the code. As a consequence, if the user switches back to the rich text editor, all the markup will be lost, and they’ll see unformatted “Green Text”.
Is there any way to tell IE to display raw HTML in textareas instead of formatting the text?
You have to escape the html with its equivalent entities for IE.