Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE not working when loading two textareas

Tags:

tinymce

I have two textareas that I load when the page loads, these two textareas are in the same table row. My tinyMCE looks like this

            tinyMCE.init({
                mode : "textareas",
                theme : "simple"
            });

For some odd reason only the first textarea gets assigned the editor and the second does not. Although it only does this in Firefox. The text areas have different names and don't contain ids. Any advice will be appreciated.

like image 298
Elitmiar Avatar asked Sep 08 '26 13:09

Elitmiar


1 Answers

Give them different ids. Tinymce editor id is equal to the textareas id; if no textarea id is present "content" is used as default. In your case for both textareas. Because there is already a tinymce editor with id "content" when the second textarea is being converted into a tinymce editor instance - it fails.

like image 84
Thariama Avatar answered Sep 11 '26 18:09

Thariama



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!