Here is what I want to do: display a form, allow the user to enter values, then re-display the form with underneath it the results retrieved as a result of the submit (if you look at how search works on drupal.org you'll have a good idea of the kind of thing I want to do).
There seem to be two ways of getting to where I want to go:
1) write a _submit function which collects the $form_values and then uses a call to drupal_goto() to get a menu callback, passing the parameters I have just picked up in the query string.
I'm not completely satisfied with this solution, since it means an enormous long query string which has to be built and unpacked.
2) define an #action for the form and then use that page to regenerate the form with the results from the original form. This seems to work, but I'm not completely satisfied with that either because as far as I can see there is only one way to get the form data back and that is to use $edit = $_POST['edit'] which goes against the philosophy of the form anyway.
Maybe I'm doing the wrong thing? Is there some other method which I've missed?
Comments
Well there may be a way by
Well there may be a way by preventing the redirection ($form['#redirect'] = FALSE) and then doing something in the _submit, although it may still turn out a bit kludgy. (My post here is on a loosely related theme.)