views:

116

answers:

1

Seems like a simple problem, I have a form and when someone needs to edit data, the textarea that is controlled by TINYMCE loads the values, but when I change it and submit the form, the new changes are not being posted.

What am I doing wrong?

UPDATE How do I do it via this, or do it say on click in the editor. I am using jquery validate, this is the submit handler.

$(form).ajaxSubmit({
                target:'#result',
                success:function(){

                    $('html, body').animate({scrollTop:'90px'}, 500);},
                clearForm: false});

                }});
+5  A: 

You have to call tinyMCE's save method when the user clicks the submit button:

$(form).ajaxSubmit({
    beforeSerialize: function() {
        tinyMCE.get('content').save();  // 'content' is the id of your textarea
    },

    ...
});

Reference: http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/save

scribu
Makes sense, I am using jquery to validate it with ajaxsubmit. How do you call it with the api? I'm not very good in using api's. Thank you
matthewb
See edited answer.
scribu
That works as a separate button, I tried putting that line in the beforeSubmit of the ajax post but that doesn't work. Is there another spot to place it so it can be 1 button, that validates, then submit's the form?? Thanks for the help so far, almost got it
matthewb
Try beforeSerialize instead of beforeSubmit.
scribu