Alter Views exposed filter form I'm trying to add more elements to the exposed views filter form but am running into an odd problem that is confusing the heck out of me.

I'm using a hook_form_alter call in a custom module to add new select drop downs.  This works great, except that they get rendered out as part of the submit element.

function my_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['test'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; 'New Filter',
    '#options' =&gt; array('value 1', 'value 2')
  );
}


Rendered it looks like this:

&lt;div class="views-exposed-form"&gt;
  &lt;div class="views-exposed-widgets clear-block"&gt;
    &lt;div class="views-exposed-widget views-widget-filter-field_node_status_value_many_to_one"&gt;
      &lt;label for="edit-node-status"&gt; Approval Status &lt;/label&gt;
      &lt;div class="views-widget"&gt;
        &lt;div class="form-item" id="edit-node-status-wrapper"&gt;
          &lt;select name="node_status" class="form-select" id="edit-node-status"&gt;&lt;option value="All" selected="selected"&gt;&amp;lt;Any&amp;gt;&lt;/option&gt;&lt;option value="0"&gt;queued&lt;/option&gt;&lt;option value="1"&gt;approved&lt;/option&gt;&lt;option value="2"&gt;denied&lt;/option&gt;&lt;/select&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

&lt;!-- Select SHOULD go here --&gt;

  &lt;div class="views-exposed-widget views-submit-button"&gt;
    &lt;input type="submit" id="edit-submit-wpg-content-bulk-admin" value="Apply" class="form-submit"&gt;
    &lt;div class="form-item" id="edit-test-wrapper"&gt;
      &lt;label for="edit-test"&gt;New Filter: &lt;/label&gt;
      &lt;select name="test" class="form-select" id="edit-test"&gt;&lt;option value="0"&gt;value 1&lt;/option&gt;&lt;option value="1"&gt;value 2&lt;/option&gt;&lt;/select&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;


Does anyone know what I'm missing here?  Why would the newly added 'test' element be rendered inside the submit element wrapper?
You need to turn the new form item test into a widget by declaring the item in $form['#info']

So your code should look like the following:

function my_module_form_alter(&amp;$form, &amp;$form_state, $form_id){
  $form['test'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; 'New Filter',
    '#options' =&gt; array('value 1', 'value 2')
  );

  $form['#info']['test'] = array(
    'value' =&gt; 'test', 
  );
}