You are here

function mailchimp_validate_email in Mailchimp 7.4

Same name and namespace in other branches
  1. 8 mailchimp.module \mailchimp_validate_email()
  2. 7.5 mailchimp.module \mailchimp_validate_email()
  3. 2.x mailchimp.module \mailchimp_validate_email()

Form element validation for email input of #type 'textfield'.

Note: #maxlength and #required are validated by _form_validate() already.

1 string reference to 'mailchimp_validate_email'
mailchimp_insert_drupal_form_tag in ./mailchimp.module
Convert mailchimp form elements to Drupal Form API.

File

./mailchimp.module, line 1716
Mailchimp module.

Code

function mailchimp_validate_email(&$element, &$form_state) {
  if ($element['#value'] && !valid_email_address($element['#value'])) {
    form_error($element, t('"%mail" is not a valid email address.', array(
      '%mail' => $element['#value'],
    )));
  }
}