Latest news
Home » Tag Archives: Pass custom error message zend form

Tag Archives: Pass custom error message zend form

Pass custom error message to zend/socialengine form from controller

$this->view->form = $form = new User_Form_Admin_Universities_Createdomain(); $this->view->university_id = $iId = $this->_getParam(‘id’, null); $form->populate(array(‘university_id’=>$iId)); if($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) ) { $iExists = $oUniversitydomains->ifExistsDomain(‘domain’, $aData[‘domain’], $aData[‘university_id’]); if($iExists > 0) { $message = ‘Domain Name Already Registered’;              $form->getElement(‘domain’)->addError($message);              return; } }

Read More »