You are here

function mass_contact_mail_page_validate in Mass Contact 5

Same name and namespace in other branches
  1. 5.2 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()

Validate the site-wide contact page form submission.

File

./mass_contact.module, line 450
Enables mass contact form to 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.'));
  }
}