tags:

views:

77

answers:

1

hello there, desperately need help..

im using jquery & tinyMCE to submit the textarea but ive tried many options still the I cant post the value.. kindly need anyone to fix this code and give a clue.. your help is very much appreciated..thank you.. 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>       
A: 

To get the HTML use something like this:

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

briefnya is your element_id.

Then you can post the contents of your textarea and it will contain your HTML from TinyMCE.

Todd Moses