views:

460

answers:

2

I'm trying to get a rich text editor in a jquery dialog box. I'm currenty trying tiny mce. When I don't initialize tiny mce the text area displays the text with the HTML characters.

When I do initialize tiny mce nothing is displayed in the text area. Any ideas on how to get a text editor in the dialog box?

<textarea id="reason" rows="8" cols="35" name ="reason">test</textarea>

tinyMCE.init({
    mode:"textareas",
    theme:"advanced",
}); 
+1  A: 

try to initialize mce on open event of dialog. Like this:

$('.selector').dialog({
   //... other options ...
   open: function(event, ui) { 
     tinyMCE.init({
        mode:"textareas",
        theme:"advanced",
     }); 
   }
   //.... other options ...
});

see if this helps you...

Reigel
+1  A: 

You should probably try to initialize the tinyMCE editor when the dialog is opened. Maybe something like this:

   $('.selector').dialog({
        open: function(event, ui) { 
         tinyMCE.init({
           mode:"textareas",
           theme:"advanced",
         }); 
        }
   });
Vincent Ramdhanie
hahaha jinx! :D we have the same answer!..
Reigel
@Reigel Maybe great minds and all of that...
Vincent Ramdhanie