I hava an textarea and I am using tinyMCE on that textarea.
What I am doing actually is that when the page is opened, I am populating the textarea with some text, and after that I am initializing the tinyMCE.
The problem is when I am trying to change the value of the textarea after tinyMCE initializing, then nothing happens.
Here is an example.
Creating the textarea:
<textarea style=width: 95%; name=title id=title></textarea>
Populating the textarea:
$('#title').html(someText);
Initializing tinyMCE
tinyMCE.init({
// General options
mode : specific_textareas,
theme : advanced,
width: 100%,
plugins : pagebreak,paste,fullscreen,visualchars,
// Theme options
theme_advanced_buttons1 : code,|,bold,italic,underline,|,sub,sup,|,charmap,|,fullscreen,|,bullist,numlist,|,pasteword,
theme_advanced_buttons2 :,
theme_advanced_buttons3 :,
theme_advanced_buttons4 :,
theme_advanced_toolbar_location : top,
theme_advanced_toolbar_align : left,
theme_advanced_statusbar_location : bottom,
valid_elements : i,sub,sup,
invalid_elements : p, script,
editor_deselector : mceOthers
});
I would like to change the content of the textview (but it is not working)
I have tryed to use the same as before init the tinyMCE
$('#title').html(someModifiedText); // does not work
I have also tryed to remove tinyMCE:
if(tinyMCE.getInstanceById('title'))
removeTinyMCE(title);
With
function removeTinyMCE (dialogName) {
tinyMCE.execCommand('mceFocus', false, dialogName);
tinyMCE.execCommand('mceRemoveControl', false, dialogName);
}
And thet to reuse:
$('#title').html(someModifiedText); // does not work
I am out of ideas... Thank you very much for your help....