vendredi 16 octobre 2015

Double instance of tinyMCE on one page

I have been trying to add two instances of the TinyMCE editor into one page and I couldn't, so I did a bit of research and tried to separate the id's for each <textarea>. For this I added this code to my JS:

JS

  tinymce.init({
        selector: "#mytextarea1",
        mode : "exact",
        elements :"area1",
        menubar: false,
        statusbar: false,
        height : 240,

    });

    tinymce.init({
        selector: "#mytextarea2",
        mode : "exact",
        elements :"area2",
        menubar: false,
        statusbar: false,
        height : 240,

    });

Since I am working with laravel 5, this is the code that I used for the forms:

Laravel - Blade

TinyMCE Instance #1 (Works)

{!! Form::textarea('noteContent',null,array( 'id'=>'mytextarea1')) !!} 

TinyMCE Instance #2 (Doesn't work, instead shows normal textarea box)

{!! Form::textarea('noteContentEdit',null,array( 'id'=>'mytextarea2')) !!} 

Am I doing something wrong? I read I had to make sure the selector's are different in each element and I thought I had, but I must be doing something wrong, Thank you in advance.

P.S This is the SO question I tried to incorporate into my problem.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1GapbbE
via IFTTT

Aucun commentaire:

Enregistrer un commentaire