Topic: How to reset tinyMCE fields in a form using RJS?

Hi,

I want to reset a form using RJS, but page[:comment_form].reset is not able to reset the tinyMCE fields.

i went to tinyMCE's forum and found this post http://tinymce.moxiecode.com/punbb/view … pid=10748, it uses the following code to clear the field,

tinyMCE.idCounter=0;
tinyMCE.execCommand('mceAddControl', true, 'editor_content');

but i dont know how to make use of that code inside RJS.

can someone help me?

thank you.

Re: How to reset tinyMCE fields in a form using RJS?

try this one

page << "tinyMCE.idCounter=0;
tinyMCE.execCommand('mceAddControl', true, 'editor_content');
"

Not tested.

Re: How to reset tinyMCE fields in a form using RJS?

it didn't work

it pops up an alert box saying: Error: Could not find the target element.

firebug ruturns no error.