Mootools, Ajax forms and tinyMCE

Submitting a form via ajax but using tinyMCE at the same time? Run into the problem where tinyMCE content won’t post via ajax? I may have the solution for you! ;)

The Code:

$(‘tinyMCE_content’).setProperty(‘value’,tinyMCE.get(‘tinyMCE_content’).getContent());

The Example:

$(‘submit’).addEvent(‘click’,function(e) {
var e = new Event(e).stop();
$(‘tinyMCE_content’).setProperty(‘value’,tinyMCE.get(‘tinyMCE_content’).getContent());
new Ajax( ‘index.php’, {
method: ‘post’,
data: $(‘form’).toQueryString()
}).request();
});

Comment are closed.