(search) form without redirect or submit handler Use case:
Search field e.g. in the header, that leads to a url with GET query string.

The usual flow of forms built with Drupal 7 form API is like this:


User visits a page with the form.
User submits, $_POST or $_GET
Validate + submit handlers are called
Redirect to a new page.


What i would like instead:


User visits page with the form, that was built with form API.
User submits, resulting in a $_GET request, e.g. example.com/search?query=foo+bar.
The page example.com/search?query=foo+bar is served, without thinking about form API.


So, I want to use form API to build the form HTML (cause it's convenient), but not any submit magic.

Ideas?
Maybe I could find an example in existing modules, but I am looking for a "big picture" or documentation.
Not sure what you're exactly asking but everything should be well documented on Form API

I've recently done a form like this so I can give you an example of a GET method form:

/**
 * Form function for iwm_collections_search_form block
 */
function mymodule_search_form($form, &amp;$form_state) {
  $form['#action'] = url(MYMODULE_SEARCH_PATH);
  $form['#method'] = 'get';
  $form['#attributes'] = array('class' =&gt; array('form-main'));
  $form['#after_build'][] = 'mymodule_search_form_after_build';
  $form['query'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Keywords'),
    '#default_value' =&gt; '',
    '#size' =&gt; 30,
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#name' =&gt; '',
    '#value' =&gt; '',
    '#attributes' =&gt; array(
      'class' =&gt; array(
        'submit',
      ),
    ),
  );

  return $form;
}


You need an #after_build function to remove the unnecessary hidden fields so that it doesn't clutter the address bar:

/**
 * After build callback for mymodule_search_form
 */
function mymodule_search_form_after_build($form) {
  unset($form['form_token']);
  unset($form['form_build_id']);
  unset($form['form_id']);
  return $form;
}


No javascript, no submit handlers, easy.