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.
drupal_goto
, with your query ?