You are here

function contact_category_edit_form_validate in Contact 6.2

Same name and namespace in other branches
  1. 7.2 contact.admin.inc \contact_category_edit_form_validate()

Validate the contact category edit page form submission.

File

./contact.admin.inc, line 114
Admin page callbacks for the contact module.

Code

function contact_category_edit_form_validate($form, &$form_state) {

  // Validate and each e-mail recipient.
  $recipients = explode(',', $form_state['values']['recipients']);
  foreach ($recipients as &$recipient) {
    $recipient = trim($recipient);
    if (!valid_email_address($recipient)) {
      form_set_error('recipients', t('%recipient is an invalid e-mail address.', array(
        '%recipient' => $recipient,
      )));
    }
  }
  $form_state['values']['recipients'] = implode(',', $recipients);
}