Hello
I am developing a module that has a form to be submitted. With just a textfield anda submit button I had no problems. When I added 3 select fields I get an Undefined index in my form handler. My code is as follows
This is my form with only the textfield
function people_search_block_form($form, &$form_state) {
$form['keys'] = array(
'#type' => 'textfield',
'#size' => 60,
'#required' => TRUE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Search',
);
return $form;
}
This is the new form with the extra fields
function people_search_block_form($form, &$form_state) {
$form['keys'] = array (
'#type' => 'fieldset',
);
$form['keys']['first'] = array(
'#type' => 'textfield',
'#size' => 60,
'#required' => TRUE,
);
$form['keys']['second'] = array(
'#type' => 'select',
'#title' => t('Division'),
'#options' => array(
'title' => 'Title',
'title1' => 'Title1',
),
);
$form['keys']['third'] = array(
'#type' => 'select',
'#title' => t('Field'),
'#options' => array(
'title' => 'Title',
'title1' => 'Title1',
),
);
$form['keys']['last'] = array(
'#type' => 'select',
'#title' => t('Project'),
'#options' => array(
'title' => 'Title',
'title1' => 'Title1',
),
);