tinyMCE Ajax Form submit send empty Value error


How to fix tinyMCE Ajax Form submit from sending empty Value.

here is to use malsup ajax form jquery plugin and tinyMCE to work together as ajax form submit:

$(‘form#formNewQuestion’).on(‘submit‘, function(form){
            // save TinyMCE instances before serialize
            tinyMCE.triggerSave();

});
//save form via ajax
$(‘form#formNewQuestion’).ajaxForm(options);

 

now your textarea will not empty.

tags : how to ajav save tinyMCE using Malsup Ajax form jquery plugin

One thought on “tinyMCE Ajax Form submit send empty Value error

  1. sory can you help me fo my script
    $(“.submit_button”).click(function() {
    var textcontent = $(“#content”).val();
    var kuis_id = $(“#kuisid”).val();
    var dataString = ‘content = ‘ + textcontent;
    var postData = $(“#kuis”).serialize()
    tinyMCE.triggerSave();
    event.preventDefault();

    $(“#flash”).show();
    $(“#flash”).fadeIn(400).html(‘Loading..’);
    $.ajax({
    type: “POST”,
    url: “action/action.php”,
    data: postData,
    cache: true,
    success: function(html) {
    $(“#show”).after(html);
    document.getElementById(‘a’).value = ”;
    document.getElementById(‘b’).value = ”;
    document.getElementById(‘c’).value = ”;
    document.getElementById(‘d’).value = ”;
    document.getElementById(‘e’).value = ”;
    document.getElementById(‘f’).value = ”;
    $(“#flash”).hide();
    $(“#content”).focus();
    }
    });
    where i isert your script ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s