Any one a idea how to simply create a form with Zend_Form and jquery? I want to use Zend_Form to validate the form so I don’t have to dual script the form in JavaScript and PHP.
Thank you,
Ivo Trompert
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No problem there.
Add ZendX_JQuery to your library if you use autoload.
Then extend ZendX_JQuery_Form to your needs. Do your stuff in the init() method of your class.
For example, I was able to create an AutoComplete field which has regular Zend_Form validation plus JQuery behavior like this:
Then I even changed the default decorators like this:
And finally add to my form (remember I’m in the init() so I’ll address it via $this):
There you are, the magic is done.
PS: don’t forget to add the following in your bootstrap: