I have a module with a simple form running on Drupal 5.x. At the base level, all it needs to do is the user selects an item from a drop-down menu, hits a button, and a list of items is returned. The returned items need to be editable (i.e. textfields). I have looked at the multi-step form documentation, I have looked through what seems like hundreds of forum posts trying to wrap my head around how this should work. Right now, I'm using regular buttons instead of submits, and catching the input in my _validate() function. That part works fine.
What I'm having difficulty with is generating the new form elements that are returned from the database call. Here's some sample code that illustrates what I have right now.
function my_form()
{
$form['view'] = array(
'#type' => 'fieldset',
'#title' => 'View Mode',
'#collapsible' => TRUE,
'#collapsed' => FALSE
);
$form['view']['categories'] = array(
'#type' => 'select',
'#title' => t('Categories: '),
'#options' => $categories
);
$form['view']['view_cat_items'] = array(
'#type' => 'button',
'#value' => t('View all items in category'),
'#submit' => FALSE,
'#button_type' => 'submit',
);