You are here

function contact_mail_page_validate in Drupal 4

Same name and namespace in other branches
  1. 5 modules/contact/contact.module \contact_mail_page_validate()
  2. 6 modules/contact/contact.pages.inc \contact_mail_page_validate()

Validate the site-wide contact page form submission.

File

modules/contact.module, line 492
Enables the use of personal and site-wide contact forms.

Code

function 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('mail', t('You must enter a valid e-mail address.'));
  }
}