I've been unable to get the value of a TinyMCE textarea, I just cant get the value from it?
This is my form (oh so simple):
<div id="pow_form_container">
<form id="pow_content_form">
<textarea name="pow_content" id="tiny" style="width:100%">
<? echo $pow; ?>
</textarea>
<input type="hidden" id="pow" name="pow" />
</form>
</div>
And this is the JQuery ive been using to tray and get the content of the editor
save_pow: function (job_id) {
var editor = tinymce.get("tiny"),content = editor.getContent();
$.post('/jobs/save_pow/' + job_id, $('#pow_content_form').serialize(), function (response) {
alert(content);
if (response.status == 'ok') {
tinymce.EditorManager.execCommand('mceRemoveEditor',true, "tiny");
Common_UI.dialog_close('edit_pow_dialog');
}
});
},
But what gets posted is :
pow_content=++++%09%09++++%09&pow=
WTF is that?
I've tried things like:
tinyMCE.triggerSave();
SO
save_pow: function (job_id) {
tinyMCE.triggerSave();
$.post('/jobs/save_pow/' + job_id, $('#pow_content_form').serialize(), function (response) {
if (response.status == 'ok') {
Common_UI.dialog_close('edit_pow_dialog');
}
});
},
But that doesn't change anything, how can it be this hard? Have a missed something?
I am initializing tinyMCE with this as the text editor is on a jquery UI popup dialog and its the only way I could get the editor to show: edit_pow: function (job_id) { $.get('/jobs/edit_pow/' + job_id, function (data) {
Common_UI.dialog('edit_pow_dialog', 'Edit Programme of Works', data, {
'Save': function () {
method.jobs.save_pow(job_id);
}
});
tinyMCE.init({ selector:'#tiny' });
});
},