title: Drupal form validation not working for me
body: <p>I am trying to modify some Drupal 6 form code and incorporate some native form validation. Code looks like this, but validation does not work.  I never even get into function thisFormName_form_validate.  Any Drupalians have some good ideas? </p>
  
  <pre><code>function thisFormName_form_alter(&amp;$form, $form_state, $form_id) {
    $form['email_address'] = array(
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('Enter your email address (optional)'),
      '#default_value' =&gt; $object['email_address'],
      '#weight' =&gt; 4,
      '#size' =&gt; 60,
      '#maxlength' =&gt; 128,  
      '#description' =&gt; t('Enter email address.'),
    );
  
  
  function thisFormName_form_validate($node, &amp;$form) {
    if ($form_state['values']['email_address'] == '') 
    {
      form_set_error('', t('Email must be valid format if entered.'));
  
    }
  }
  </code></pre>