You are here

function mass_contact_mail_page_validate in Mass Contact 5.2

Same name and namespace in other branches
  1. 5 mass_contact.module \mass_contact_mail_page_validate()
  2. 6 mass_contact.module \mass_contact_mail_page_validate()
  3. 7 mass_contact.page.inc \mass_contact_mail_page_validate()

Validates the main Mass Contact mail form.

Parameters

form_id: The unique string identifying the form.

form_values: The array of values returned by the form.

File

./mass_contact.module, line 976
This is the main code file for the Mass Contact module. This module enables users to contact multiple users through selected roles.

Code

function mass_contact_mail_page_validate($form_id, $form_values) {
  if (!$form_values['cid']) {
    form_set_error('category', t('You must select a valid category.'));
  }
  if (!valid_email_address($form_values['mail'])) {
    form_set_error('mass_contact', t('You must enter a valid e-mail address.'));
  }
  _mass_contact_upload_validate($form_id, $form_values);
}