'Member has changed Email at mncar.org' ); /** * @param $form Form * @return Form */ function _bindFormFields($form) { $form->addElement('text', 'email', 'Email Address (Web Site Login)', array('class'=>'inp_email', 'size' => 80)); $form->addRuleRequired(array('email')); $form->addRuleEx(array('email'), 'is in wrong format', 'email'); $form->addFormRule(array($this, 'validateForm')); $form->setSubmitTitle('Submit'); $form->setCancelType(''); return $form; } function validateForm($data) { $errors = array(); if ($data['email'] && !$this->DBObj->isUnique('email', $data['email'])) { $errors['email'] = 'Email already in use. Please choose another one.'; } return empty($errors) ? true : $errors; } }