5
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_submit($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;
}
したがって、基本的にデータベースから何かを検索するフォームが必要です。 一度送信するには、検索をクリックし、結果を取得します。drupal 7カスタムモジュールでフォームを送信した後にデータベースを照会して結果を表示
同じフォームページのフォームのすぐ下に結果を表示したいとします。 元のフォームページの別のページには移動しないでください。フォームがクリーンであることができる
/ファインで元の状態へリセット。
http://drupal.org/node/542646 このディスカッションは私が欲しいものですが、確かな結果や解決策はありません。
ありがとうございました。テスト済み。うまくいった。 –
ありがとうございました。助けました。とてもうまくいっていますが、Ajaxの送信ボタンではうまくいきませんでした。それでも問題は解決しました。 – Aniruddhsinh