shapper ha scritto:
Hello,

I want to add TinyMCE to the TextAreas with classes "A" and "B" that
show in my pages.

TinyMCE allows only to apply it by ID's or to all Text Areas.

How can I apply TinyMCE using JQuery to TextAreas by CSS Class?

Thanks,
Miguel

I've used this way: (every textarea of class "a" must have a single id)

elems = '';
$('.a').each(function() {
 if(elems !='') {
   elems += ',';
 }
 elems += this.id;
});

initTinymce(elems);

function initTinymce(elems) {
 var elems;
 if(typeof(elems) == 'undefined') {
   mode = 'textareas';
   elems = '';
 } else {
   mode = 'exact';
 }
 tinyMCE.init({
   theme : "advanced",
   mode : mode,
   elements : elems,
   .....
});
}

--
gianiaz.net - web solutions
p.le bertacchi 66, 23100 sondrio (so) - italy
+39 347 7196482

Reply via email to