I am using tinymce editor and i have 4 textarea in my form when i use tinymce change all my textarea to editor but i want change only one my textarea to editor. it’s my tinymce code:
JavaScript
x
13
13
1
<script type="text/javascript">
2
tinymce.init({
3
selector: "textarea",
4
plugins: [
5
"advlist autolink lists link image charmap print preview anchor",
6
"searchreplace visualblocks code fullscreen",
7
"insertdatetime media table contextmenu paste ",
8
"textcolor"
9
],
10
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcolor"
11
});
12
</script>
13
how can do it? thank you
Advertisement
Answer
Read this article in the TinyMCE manual. Use mode
either with specific_textareas
or exact
.
Your initialisation code should look like this:
JavaScript
1
6
1
tinyMCE.init({
2
3
mode : "specific_textareas",
4
editor_selector : "YourOwnEditor"
5
});
6
…or…
JavaScript
1
6
1
tinyMCE.init({
2
3
mode : "exact",
4
elements : "myarea1"
5
});
6
…and your HTML could look like this:
JavaScript
1
3
1
<textarea id="myarea1" class="YourOwnEditor">This will be the editor!</textarea>
2
<textarea id="myarea2">This will not be an editor.</textarea>
3