Ajaxify Your Zend_Form Validation with jQuery

April 9th, 2010

We’re going to take what was put together in the last 3 videos and now include some server-side validation that will appear asynchronously. This is an example of using Zend_Form as a validation tool via JSON.

Grab a copy of the project or browse the repository.

UPDATE: as a couple people have mentioned, you can cut down your IndexController even more by using the Zend_Json view helper:

public function validateformAction()
{
$f = new Form_Registration();
$f->isValid($this->_getAllParams());
$this->_helper->json($f->getMessages());
}

Enjoy!

 

Making JSON Objects from Zend_Controllers (Using JQuery)

February 18th, 2009

I started this video thinking it would be short and it ended up close to 30 minutes. If you find these videos too long, please let me know and I’ll break them up.

In my own defense, this video covers a lot of ground. I introduce JQuery and immediately put it to work for sending and receiving JSON requests to our Zend_Controller. The JSON is automatically generated from a set of PHP classes in a PHP array, thanks to Zend_Json.

also, download the project file for this episode.

 
Desktop RSS feed iPhone + iPod