tinymce: clear field

by prettyscripts on 2008-09-22 16:22:57

freejavascriptxajaxtinymce

the normal way to clear <textarea> field:

Code:

document.formname.textareaid.value = '';

for <textarea> converted into tinymce editor, the above javascript call does not work. you need to call tinyMCE.setContent()

Code:

tinyMCE.getInstanceById('textareaid').setContent('');

to call from xajax function:

Code:

$xajax->script("tinyMCE.getInstanceById('textareaid').setContent('');");

Tags: clear, editor, textarea, tinymce, xajax

2 comments

Comment by nilesh @ 2010-05-19 20:38:23
*****
Thanks..you saved my life...
Comment by ananymous @ 2011-02-15 17:06:09
Thank you very much...it works....

Leave a comment


Your email address will not be revealed on this site.
PoorExcellent
note: all comments are moderated. do not spam and do not advertise. only comments relevant to the post will be published.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)