On Fri, Nov 21, 2008 at 9:11 AM, Marko Korhonen <[EMAIL PROTECTED]> wrote: > > Hi, > > I use "class" attribute to "bind" FCKeditor to textarea fields. > > Example (I use ini files): > ; content element > form.elements.content.type = "textarea" > form.elements.content.options.required = true > form.elements.content.options.label = "Content" > form.elements.content.options.attribs.class = "editor" > > And in my global JavaScript (jQuery example): > > ta = $(".editor"); // find all textareas with editor class > > $.each(ta, function(i, textarea){ > > var oFCKeditor = new FCKeditor(textarea.name); > > oFCKeditor.BasePath = baseUrl +"js/fckeditor/"; > oFCKeditor.ToolbarSet = "Basic"; // Here you could make some > logic how to > set different toolbarset, maybe adding more classes to the textarea? > class="editor Default" > > // if ($(textarea).hasClass("Default")) oFCKeditor.ToolbarSet = "Default" > > oFCKeditor.ReplaceTextarea(); > > }) > > And of course I add fckeditor.js to my actions where I render forms. > > br, > Marko
Just wanted to second Marko's solution since I did almost the same. Almost because I had a single text field and used an ID to bind fckeditor - $('#wysiwyg'). ;-) (The ID selector should be slightly faster in that case.) So far this seems to be the most clean integration between Zend_Form and fckeditor. No hacking necessary. :-) Till