drupal_100
asked on
drupal 7 Query database and display results after form submit in custom module
function mymodule_search_form($form , &$form_state) {
$form..... define the form here
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Search',
);
return $form;
}
function mymodule_search_form_submi t($form, &$form_state) {
process the form and get result
$output = this is the result with a table of data.
I want to display the result table here.
Now I can only use drupal message to display on top.
drupal_set_message($output );
return;
}
So basically I want to have a form to search something from database.
Once click the submit to search, and get the result.
I want to display the result just under the form in the same form page.
DO NOT GO TO ANOTHER PAGE, JUST IN THE ORIGINAL FORM PAGE.
The form can be clean/reset into original status, which is fine.
http://drupal.org/node/542646
This discussion is what I want, but there looks no solid result/solution there.
$form..... define the form here
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Search',
);
return $form;
}
function mymodule_search_form_submi
process the form and get result
$output = this is the result with a table of data.
I want to display the result table here.
Now I can only use drupal message to display on top.
drupal_set_message($output
return;
}
So basically I want to have a form to search something from database.
Once click the submit to search, and get the result.
I want to display the result just under the form in the same form page.
DO NOT GO TO ANOTHER PAGE, JUST IN THE ORIGINAL FORM PAGE.
The form can be clean/reset into original status, which is fine.
http://drupal.org/node/542646
This discussion is what I want, but there looks no solid result/solution there.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.