I am creating a module using the Form API. The form is intended to provide data for querying a database and displaying a table based on the query. When the user submits, I want both the form and the data table to render on the same page so that the user can keep changing criteria and viewing the result.
I am assuming I can do something like this:
theme_myform ($form) {
$output = drupal_render($form);
$output .= build_table();
return $output;
}
However, before building the table and appending it to the form, I need to test to see if the form has been successfully posted and I will also need to capture some of the posted values to run the query for producing the table. How do I get access to $form_values (or something similar) in my theme function.
I am sure this is a simple thing, but the only stuff I have been able to find online is instructions on adding to the form itself depending on previous submissions.
Thanks in advance for the help.
Comments
Ok, I have made some headway
Maybe other folks will find this useful. Also looking for alternative routes to the same result. Basically I am trying to append a report (in a table) to a successfully submitted user form.
Let's assume my form is called myform.
I added this to my module
I was looking for something
I was looking for something similar for Drupal 6 and I found that this can be done by setting a parameter in $form_state:
$form_state['storage'] = TRUE;