I am using tinymce, Is it possible to apply for only one textarea

Navruk picture Navruk · Mar 4, 2011 · Viewed 42.2k times · Source

I am using tinymce, I have multiple text areas on my page. Is it possible to apply for only one textarea,

1 text area is for description validation is like below

var text = tinyMCE.get('txtdesc').getContent();

But i have more 3 more text areas in my page so tineMCE should not apply for all these text areas

How can i apply only for one text area

// this is my tinyMCE code 
    tinyMCE.init({
        mode : "textareas",
        theme : "advanced"
    });

// /tinyMCE

Answer

chinna picture chinna · Mar 4, 2011

For the textarea assign a class="" to textarea property, this will support for you

<script type="text/javascript">
    tinyMCE.init({
        //mode : "textareas",
        mode : "specific_textareas",
        editor_selector : "myTextEditor",
        theme : "simple"
    });
</script>

<textarea id="txtdesc" name="txtdesc" class="myTextEditor" rows="6" cols="96" ></textarea>