A
A
aronsky2012-11-03 11:25:27
JavaScript
aronsky, 2012-11-03 11:25:27

Form element decorators and javascript in ZF?

Tell me, how to correctly add JS code to form decorators in ZF? I need to load TinyMCE to a text input field and add validation to other fields using JavaScript. I think it's right to do this using a decorator, but then it's not clear where the js files will be added to the page (in theory, they should be added to the header). How to write such a decorator?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sajgak, 2012-11-03
@sajgak

the simplest option is to always connect all js files (on the product they are all compressed into 1 file), in ZF specify the class name to the input on which you need to hang TinyMCE and in js hang your plugin on this class

T
turist_ua, 2012-11-06
@turist_ua

decorator class: pastebin.com/U4nyWyhS
partial view file - pastebin.com/TaDDyWXj

V
vkachalov, 2012-11-06
@vkachalov

Do it through a separate element. It's not hard. See for example ZendX_JQuery_Form_Element_DatePicker and ZendX_JQuery_View_Helper_DatePicker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question