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?
function thisFormName_form_alter(&$form, $form_state, $form_id) {
$form['email_address'] = array(
'#type' => 'textfield',
'#title' => t('Enter your email address (optional)'),
'#default_value' => $object['email_address'],
'#weight' => 4,
'#size' => 60,
'#maxlength' => 128,
'#description' => t('Enter email address.'),
);
function thisFormName_form_validate($node, &$form) {
if ($form_state['values']['email_address'] == '')
{
form_set_error('', t('Email must be valid format if entered.'));
}
}