You are here

function multiple_email_edit_form_validate in Multiple E-mail Addresses 6

Same name and namespace in other branches
  1. 7 multiple_email_edit_page.inc \multiple_email_edit_form_validate()
  2. 2.x multiple_email_edit_page.inc \multiple_email_edit_form_validate()

Validates multiple_email_edit_form

Parameters

string $form_id:

array $form_values:

File

./multiple_email_edit_page.inc, line 76
Functions for the page to edit an existing e-mail address in the registry.

Code

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