How do you add javascript to forms created with the Zend framework? For instance, if I wanted to validate the form, or if I wanted to utilize events like blur, focus and onclick?
What I tend to do is :
Zend_Form
and the related classes
If you are using jQuery, you can detect when the page is loaded $.ready
, and hook a function on that event -- function that will add some dynamic bahaviors to your form.
Of course, you can do the same sort of thing with other JS libraries -- I only took jQuery as an example because of its popularity, and the fact there are some jQuery-related components in ZendX.