tinymce: clear field
Categories: javascript, ajax, tinymce
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('');"); |
2008-09-22 16:22:57 • Link • Comments • Trackbacks
tinymce and xajax: data in the editor is not submitted
Categories: javascript, html, ajax, tinymce
i just downloaded and installed tinymce which magically converted the <textarea> element into a nice little editor, which supposely transform the input into html output. nice! no more educating non-programmers about html tags.
if you submit the form via normal post, the value for <textarea> form element is submitted. but when submitting the form via xajax, the data for the <textarea> element is empty!
after some research around the internet, found out that the solution is easy. before submitting the form, call tinyMCE.triggerSave().
more about tinymce and xajax here.
2008-06-23 15:44:11 • Link • Comments • Trackbacks
tinymce: html wysiwyg editor
Categories: javascript, html, bookmark, free, tinymce
if you’re not using any standard packages (portals, cms etc) and want to write your own form for users who don’t know anything about html to post html contents, one solution is to use tinyMCE, an open source (ie free!) javascript that transform <textarea> element into a wysiwyg editor.
have a look at the examples.
it’s relatively easy to use, if you just want a simiple editor. more advanced iimplementations require a bit of learning curves. it’s well documented in its wiki pages.
2008-06-23 11:11:51 • Link • Comments • Trackbacks
