[ACCEPTED]-I am using tinymce, Is it possible to apply for only one textarea-textarea

Accepted answer
Score: 69

For the textarea assign a class="" to textarea property, this 1 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>
Score: 49

In the TinyMCE 3.x config you can put class 4 selectors or deselectors to specifically 3 enable or disable TinyMCE on textareas with 2 certain classes, just put the class="" attribute 1 on your textarea.

editor_deselector : "mceNoEditor" // class="mceNoEditor" will not have tinyMCE
editor_selector : "mceEditor", // class="mceEditor" will.

Source.


As of TinyMCE 4.0.x

selector: "textarea", // Select all textarea
selector: "textarea.editme", // Select all textarea with the class editme
selector : "textarea:not(.mceNoEditor)", // Select all textarea exluding the mceNoEditor class

Source.

Score: 6

In TinyMCE 4.x there is no deselector so 2 you can use normal css to determine which 1 textareas are selected and which are not.

<script type="text/javascript">
  tinymce.init({
        selector: "textarea:not(.textarea-no-styles)",
 });
</script>
Score: 3

In TinyMCE 4.x, you can use editor_selector 7 option , but before that make sure you must 6 updated mode to 'specific_textareas'

    <script type="text/javascript">
  tinymce.init({
    mode : "specific_textareas",
    editor_selector : "mceEditor",
    });
</script>

Also 5 add css class same as editor_selector value 4 in your textarea, as per above example it 3 should look like this:

<textarea id='textarea1' class='mceEditor'>first text area</textarea>

now, editor will be 2 added in those textarea that have a class 1 named 'mceEditor'.

Score: 1

Here's what worked for me on version 4.6.4, and 2 it's simpler :

I've just appended #my_text_area_id 1 to my selector as follows

selector: 'textarea#elm1'
<textarea id="elm1" ...>...</textarea>

hope it helps

Score: 0

You can do this by using a selector.

selector: "#text_area_id", // Select with textarea id

0

More Related questions