function campaignmonitor_email_element_validate in Campaign Monitor 7
Form element validation handler for the subscribe email field.
1 string reference to 'campaignmonitor_email_element_validate'
- campaignmonitor_subscribe_form in ./
campaignmonitor.module - Builds the subscription form used in blocks.
File
- ./
campaignmonitor.module, line 401 - Module that plugs in Campaign Monitor functionality to your Drupal web site.
Code
function campaignmonitor_email_element_validate($element, &$form_state) {
$value = $element['#value'];
if ($value !== '' && !valid_email_address($value)) {
form_error($element, t('%name must be a valid email address.', array(
'%name' => $element['#title'],
)));
}
}