I'm brand new to Drupal, but I've been making pretty decent on a module by reading through examples and the API documentation. However, I'm having an issue that form validation that I just cannot figure out. Basically, according to everything I've read, a form_name_validate function should automatically validate any forms named form_name (unless, of course, it's overridden). However, this isn't happening. Here's a snippet my code:
function ssh_page() {
$output = '';
$host_options = array(
'server1' => t('server1'),
'server2' => t('server2'),
);
$form['host_select'] = array(
'#type' => 'fieldset',
'#title' => t('SSH Server Selection'),
'#tree' => TRUE,
);
$form['host_select']['hostname'] = array(
'#type' => 'select',
'#title' => t('Hostname'),
'#default_value' => variable_get('hostname', ''),
'#options' => $host_options,
'#required' => TRUE,
'#description' => t('SSH Server name.'),
);
$form['host_select']['port'] = array(
'#type' => 'textfield',
'#title' => t('Port'),
'#default_value' => variable_get('port', '22'),
'#size' => 5,
'#maxlength' => '5',
'#required' => TRUE,
'#description' => t('SSH Server port.'),
);
$form['host_select']['submit'] = array(
'#type' => 'submit',
'#value' => t('Connect'),
);
$output = drupal_get_form('ssh_host_form', $form);