1 email_example.module email_example_form_validate($form, &$form_state)

Form validation logic for the contact form.

Related topics

File

modules/examples/email_example/email_example.module, line 198
Example of how to use Backdrop'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.'));
  }
}