You are here

function email_example_form_validate in Examples for Developers 6

Same name and namespace in other branches
  1. 7 email_example/email_example.module \email_example_form_validate()

Form validation logic for the contact form.

Related topics

File

email_example/email_example.module, line 196
Example of how to use Drupal's mail API.

Code

function email_example_form_validate($form, &$form_state) {
  if (!valid_email_address($form_state['values']['email'])) {
    form_set_error('email', t('That e-mail address is not valid.'));
  }
}