after ajax form submit value from ckeditor textarea is not sent through post
You can force CKeditor to update the textarea value using:
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
Also, you can use .serialize
for the data - then you won't have to maintain the AJAX code if parameters change:
<script src="ckeditor/ckeditor.js"></script>
function saveArt()
{
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
jQuery.ajax({
type: 'POST',
url: 'art_save.php',
data: $("#art").serialize()
});
return false;
}
for (instance in CKEDITOR.instances)
{
CKEDITOR.instances[instance].updateElement();
}
$.ajax({
url: "controllers/c.publicidad.php?task=save",
type: 'post',
data: $("form[name='form']").serialize(),
dataType: 'json',
success: function(data) {
if(data.idenvio != ''){
$("form[name='frmPublicidad']").toggle("slow");
$("#MessageSuscripcion").html(data.message);
}
}
});