Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE inline option not working?

Tags:

tinymce

I have a tinymce 4.7.4 field.

I have applied inline option according to the documentation (https://www.tinymce.com/docs/configure/editor-appearance/) and it returns a js error? So tinymce field breaks.

Could not initialize inline editor on invalid inline target element <textarea id="Description" class="text ui-widget-content ui-corner-all input-sm tinymce" cols="20" name="Description" rows="2">

The snippet:

tinymce.init({
        selector: "textarea",
        inline: true,
        toolbar: "undo redo | bold italic | bullist numlist"
        });
like image 996
nickornotto Avatar asked Dec 12 '17 10:12

nickornotto


1 Answers

TinyMCE's inline mode does not work on <textarea> elements - it needs to be placed on block elements in the HTML page.

The most common choice would be a <div>. Here is an example:

http://fiddle.tinymce.com/2ggaab

like image 168
Michael Fromin Avatar answered Sep 23 '22 18:09

Michael Fromin