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!

mmmmm, Nice
Thanks again
Hi.
When I go to function $.post() in doValidation() in phtml file.
i not work, although the previous code
$(“input”).each(function()
{
data[$(this).attr('name')] = $(this).val();
});
works fine for me.
What is Form_Registration. I can’t find this. Can you help me?
Thank you so much. This video explains exactly what I wanted to do!
When a validation error message is produced you are already in the next input field as this is triggered on blur and tabbing back to correct this then displays a second validation error message for the field you are leaving to go back and correct the original error, if for example, input is required.
My question is, how do we get the cursor to stay in the first input if a validation error is produced, and maybe change the background colour of the input?
PS: I can only see 3 of the 54 comments below – is there a way to display all of these?
Hey Jon,
thanks for the screencast. I believe that this may be just what I’m looking for on a current project.