I have created a module that creates and displays a table and with a filter element. What I would like to do is when the user enter a string into the filter can submits it, I then use that string to filter the results of the table. What I am having an issue with is how to pass that string back into the form creation function to filter the results.
This is what I have in the submit function:
function submission_list_form_submit($form, &$form_state) {
$filter = array();
if (isset($form_state['values']['filter_user'])) {
$filter['username'] = $form_state['values']['filter_user'];
}
return $filter;
}
Which is not right obviously. How do I get the $filter variable to be passed back into the submission_list_form function that creates the page? This is being done with Drupal 7.
Thanks.