function contact_admin_edit_validate in Drupal 4
Same name and namespace in other branches
- 5 modules/contact/contact.module \contact_admin_edit_validate()
- 6 modules/contact/contact.admin.inc \contact_admin_edit_validate()
Validate the contact category edit page form submission.
File
- modules/
contact.module, line 196 - Enables the use of personal and site-wide contact forms.
Code
function contact_admin_edit_validate($form_id, $form_values) {
if (empty($form_values['category'])) {
form_set_error('category', t('You must enter a category.'));
}
if (empty($form_values['recipients'])) {
form_set_error('recipients', t('You must enter one or more recipients.'));
}
else {
$recipients = explode(',', $form_values['recipients']);
foreach ($recipients as $recipient) {
if (!valid_email_address(trim($recipient))) {
form_set_error('recipients', t('%recipient is an invalid e-mail address.', array(
'%recipient' => theme('placeholder', $recipient),
)));
}
}
}
}