You are here

function multiple_email_manage_validate in Multiple E-mail Addresses 7

Same name and namespace in other branches
  1. 6 multiple_email_manage.inc \multiple_email_manage_validate()
  2. 2.x multiple_email_manage.inc \multiple_email_manage_validate()

Handle validation of multiple_email_manage_form.

File

./multiple_email_manage.inc, line 70
Callbacks for user management of users e-mail addresses.

Code

function multiple_email_manage_validate($form, &$form_state) {
  if ($form_state['values']['email']) {
    if (!valid_email_address($form_state['values']['email'])) {
      form_set_error('email', t('You must enter a valid e-mail address!'));
    }
    elseif (multiple_email_find_address($form_state['values']['email'])) {
      form_set_error('email', t('Entered address is already registered on this site.'));
    }
  }
}