无法在tinyMCE中发布值

时间:2010-06-18 13:13:10

标签: tinymce

迫切需要帮助..

即时通讯使用jquery& tinyMCE提交textarea但我已经尝试了很多选项仍然是我不能发布价值.. 请任何人修复此代码并提供线索.. 非常感谢你的帮助..谢谢你...... wiwien

<!--tinyMCE  -->
<script type="text/javascript" src="include/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "simple",
    editor_selector : "wysiwyg"
});
</script>


<form id="formID" class="formular" method="post" action="">
....    
<fieldset>
                <legend>Creative Brief </legend>
                <label>
                    <span>Enter Your brief : </span>
                    <textarea id="briefnya" name="briefnya" rows="150" cols="150" style="width: 95%" class="wysiwyg"></textarea>
                </label>

<input type="hidden" id="userId" name="userId" value="<?=$userId;?>" >  
<input type="hidden" id="brief_html" name="brief_html" />
<input class="submit" type="submit" value="save and send CO"/>
</fieldset>
</form>


<script>
        $(document).ready(function() {
        /*var textarea = tinyMCE.get(briefnya).getContent();*/

        /*$('#brief_html').val(textarea);
        $("#formID").bind('form-pre-serialize', function(e) {
           tinyMCE.triggerSave();
        });*/
        /*$('#question_html').val(tinyMCE.get('question_text').getContent());*/

            // SUCCESS AJAX CALL, replace "success: false," by:     success : function() { callSuccessFunction() }, 
            $("#formID").validationEngine({
                beforeajaxsubmit:preSubmit(),
                ajaxSubmit: true,
                    ajaxSubmitFile: "formSubmit.php",
                    ajaxSubmitMessage: "Thank you, Your CO will be distributed. <a href=menu.php>Back to main menu</a>",
                success :  false,
                failure : function() {}
            });
</script>       

2 个答案:

答案 0 :(得分:0)

要使用HTML,请使用以下内容:

var content = tinyMCE.getInstanceById(element_id).getBody().innerHTML;

briefnya 是您的element_id

然后你可以发布textarea的内容,它将包含来自TinyMCE的HTML。

答案 1 :(得分:0)

您只需使用

即可
$('#id_of_textarea').val();

如果您已经在使用jquery