TinyMCE not sending value

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 23:54:57

问题


Hi All
It's the first time I've used Tiny Mce and I have a problem. Please Help

The editor works fine in editing but when I click submit nothing is sent from the textarea input

Here is the code:

<textarea name='proddesc' class='text_area' id='elm1' /></textarea>

I'm using jQuery, this is the code:

$('#addprod').submit(function(){
                $("#addprodmsg").hide();
        $.post('addprod.php', $("#addprod").serialize(), 
            function(data){
                    $("#addprodmsg").html(data);
        });
                $("#addprodmsg").show();
                return false;
});

The Php Code is:

foreach($_POST as $key){echo "<script>alert('$key')</script>";}

Everything alerts a value but the textarea is not alerting anything.

Also, when I disabled TinyMce and submit the form everything is ok.

2 - I'm using the rtl direction and I have this photo:

http://www.image-upload.net/images/mly8a68ufs0mdeky6low.jpg

Look At Style :(

Thank You


回答1:


It is necessary to update the textareas content with the content of the editors iframe (tinymce uses an editable iframe like most rtes). In order to achieve this you need to call tinymce.get('elm1').save(); before you submit.

You can also grab the editors content using tinymce.get('elm1').getContent(); and sent this.t




回答2:


function SubmitForm() {
    tinyMCE.triggerSave();
    $('#submit-form-training-materials').submit();
}


来源:https://stackoverflow.com/questions/5807156/tinymce-not-sending-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!