• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

tinyMCE editor question

makdeniss

Active member
#1
Hi,

This code line gives me not only the text I've typed in the editor:
Code:
var x= tinyMCE.activeEditor.getContent();
but also this kind of HTML code within it:
Code:
<p>MYINPUT_EDITOR_TEXT<br _mce_bogus="1"></p>
My question would be: how to get read the EDITOR without the formatting?
 

makdeniss

Active member
#3
This works for me:

Code:
var editor = tinyMCE.activeEditor;
editor.selection.select(editor.dom.getRoot());
var content = editor.selection.getContent({format : 'text'});
editor.selection.collapse();

alert(content);
Reference: http://tinymce.moxiecode.com/punbb/viewtopic.php?id=14446
Thanks!!!!!!!!! That really works!!!!! Now, the biggest questions is how to save the formatting during extraction and insertion? :)