Trying to create a widget that submits a form and takes you to another search page The original example http://www.trellon.com/content/blog/apachesolr-and-facetapi uses an auto submitter, which I don't want. I'm trying to modify it to use checkboxes and submit with a submit button, however that doesn't appear to be working. I can select different boxes and submit, but it doesn't take me to another search page.

class ResourceLibraryWidget extends FacetapiWidget {
   /**
   * Renders the form.
   */
  public function execute() {
    $elements = &amp;$this-&gt;build[$this-&gt;facet['field alias']];
    $elements = drupal_get_form('resource_library_facetapi_select', $elements);
  }
}

function resource_library_facetapi_select($form, &amp;$form_state, $elements) {
  // Build options from facet elements.
  //$options = array('' =&gt; t('- Select -'));
  foreach ($elements as $element) {
    if ($element['#active']) {
      continue;
    }
    $options[serialize($element['#query'])] = $element['#markup']; //. '(' . $element['#count'] . ')';
  }

  $form['select'] = array(
    '#type' =&gt; 'checkboxes',
    '#options' =&gt; $options,
    //'#attributes' =&gt; array('class' =&gt; array('ctools-auto-submit')),
    'default_value' =&gt; '',
  );
  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Find Resources'),
    //'#attributes' =&gt; array('class' =&gt; array('ctools-use-ajax', 'ctools-auto-submit-click')),
  );

  // Lets add autosubmit js functionality from ctools.
  $form['#attached']['js'][] = drupal_get_path('module', 'ctools') . '/js/auto-submit.js';
  // Add javascript that hides Filter button.
  //$form['#attached']['js'][] = drupal_get_path('module', 'example') . '/js/example-hide-submit.js';

  $form['#attributes']['class'][] = 'resource-library-checkbox-facet';

  return $form;
}


Why isn't it working the way I intend? I'm trying to change different values on the submit button, but that doesn't seem to do anything.
It's not clear from your question, so I will assume that you are missing the following:

/**
 * Submit handler for facet form.
 */
function resource_library_facetapi_select_submit($form, &amp;$form_state) {
  $form_state['redirect'] = array(
    $_GET['q'],
    array('query' =&gt; unserialize($form_state['values']['select'])),
  );
}