vladimirich
vladimirich

Reputation: 67

TinyMCE: hidden textarea

I try to setup tinyMCE on my web site. This is my settings:

<script type="text/javascript" src="extensions/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "exact",
        elements: "mceContent",
        language : "ru",
        theme : "advanced",
        forced_root_block : false,
        force_br_newlines : true,
        force_p_newlines : false,

        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,formatselect,forecolor,backcolor,link,unlink,justifyleft,justifycenter,justifyright,bullist,numlist,|,pasteword,pastetext,table,image,|,undo,redo,|,code,fullscreen",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        height: 400,
        width: 680,

        skin : "o2k7",
        skin_variant : "blue",
        theme_advanced_toolbar_align : "left",
        relative_urls : false
    });
</script>

This is my html code:

<textarea class="span8" name="mceContent" id="mceContent" rows="15" 
    style="width: 40em; height: 20em" >
        {$mceContent}
</textarea>

When I open this page text area is hidden. This is html code I see in browser:

<textarea class="span8" name="mceContent" id="mceContent" rows="15" 
style="width: 40em; height: 20em; visibility: hidden;">                 
</textarea> 

So, how can I solve this problem?

Upvotes: 2

Views: 5214

Answers (2)

Abraham Brookes
Abraham Brookes

Reputation: 1998

You are running tinymce.init() before the DOM is properly loaded. You need to wrap your init() inside a document.ready:

document.addEventListener('DomContentLoaded', function(){

    tinyMCE.init({
        // your init options
    });

});

Upvotes: 2

Varatharaj
Varatharaj

Reputation: 687

well this is not an issue. bcoz u have passed elements: "mceContent" value to tinymce constructor,by doing this the plugin will hide the matched element and it will the the editor instead.

Upvotes: 0

Related Questions