First thing you should take care while handling AJAX requests in Zend Framework - disable the view/MVC layout component.
In your action,
public function validateAction()
{
if($this->getRequest()->isXmlHttpRequest()) {
//Disable the view/layout
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(TRUE);
//Receive the value from the form
$inputValue = $this->_getParam('name');
//Access your model and validate the data.
$model = new Model();
$result = $model->isValid($inputValue);
$myArray = array(
'result'=>$result
);
$jsonData = Zend_Json::encode($myArray);
//Send the result back to the client
$this->response->appendBody($jsonData);
}
}
Receive this JSON object from client side(use jQuery), process it and show the appropriate message.