I am trying to create a form that first requests the user select a value, then upon submit, it displays 2 more fields based on the initial input. I have been successful at getting the form to actually work, but there are still two nagging problems I need to resolve.
1. When the second form displays, I see the word "Array" displayed on my page. It only appears after submitting the first form, so I have to assume that it is coming from drupal_get_form()
2. Even after the final submit is processed, the values are still being kept in form_values. That is, when I go to the form again, I still see the old options displayed. It seems there is some sort of cache or something, but I cannot figure out how to clear the values out of $form_values once the form has been submitted.
Here is the code I am working with. Note: I am calling drupal_get_form() from with a Block.
function test_form($form_values = NULL) {
// Build options_1, which will appear on both the first submit of the form and the second. The second version will have the values from the first submit already selected.
if(!$form_values['options_1']){
$options_1=get_options_array();
$form['options_1'] = array(
'#type' => 'select',
'#title' => t('Title'),
'#default_value' => '--Select Options--',
'#options' => $options_1,
'#description' => t('Description.'),
);