contact_mail_page_validate

Versions
4.7 – 5
contact_mail_page_validate($form_id, $form_values)
6
contact_mail_page_validate($form, &$form_state)

Validate the site-wide contact page form submission.

Code

modules/contact/contact.pages.inc, line 106

<?php
function contact_mail_page_validate($form, &$form_state) {
  if (!$form_state['values']['cid']) {
    form_set_error('cid', t('You must select a valid category.'));
  }
  if (!valid_email_address($form_state['values']['mail'])) {
    form_set_error('mail', t('You must enter a valid e-mail address.'));
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.