开发者

Posting New html from TINYMCE

开发者 https://www.devze.com 2023-01-01 04:50 出处:网络
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 a

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});

                }});


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

0

精彩评论

暂无评论...
验证码 换一张
取 消