addElement('text', 'email', array('label' => 'Enter your Email Address', 'required' => true)); $this->getElement('email')->addValidator('EmailAddress', true); $validatorRecordExists = new Zend_Validate_Db_RecordExists( Qs_Db::getTableName('User'), 'email', null, Qs_Db::getInstance() ); $validatorRecordExists->setMessage( "No user with such email", Zend_Validate_Db_RecordExists::ERROR_NO_RECORD_FOUND ); $this->getElement('email')->addValidator($validatorRecordExists); return $this; } protected function _initButtons() { if (!$this->_hasButtons) { return $this; } $this->addElement( 'submit', 'btnSubmit', array('label' => 'Reset Password', 'attribs' => array('class' => 'btn')) ); return $this; } }