#v6.x
Hi guys
I am wading into the swamp which is known as Drupal and I am neck deep
I am in the mists of developing my own module using the FAPI
How do I return the result from a db query based on the implementation below? (Its a one field search database carry on)
here is what I have so far...
PHP Code:
////////////////////////////////////////////////////////// // Implementation of hook_menu() function engineers_menu() {
$items = array();
$items['engineers'] = array( 'title' => 'Engineers', 'page callback' => 'engineers_form', 'access arguments' => array('access content'), 'type'=> true, ); return $items;
}
///////////////////////////////////////////////////////// /// get form //////////////////////////////////////////// function engineers_form(){
$output = t('test test test');
$output .= drupal_get_form('engineers_formfields');
return $output;
}
////////////////////////////////////////////////////////// // form fields /////////////////////////////////////////// function engineers_formfields(){
$form = array();
$form['engineers'] = array(
'#type'=>'fieldset', '#access'=>user_access('administer nodes'), '#title'=> t('Search Engineers'), '#collapsible'=> true, '#collapsed'=> false, '#tree'=>true, );
$form['engineers']['search'] = array( '#type' => 'textfield', '#title' => t('Search for Engineers'), '#size' => 60, '#maxlength' => 128, '#required' => true, );
$form['engineers']['submit'] = array( '#type' => 'submit', '#value' => t('Search'), );
return $form; }
////////////////////////////////////////////////////////// // form submit /////////////////////////////////////////// function engineers_form_submit($form, &$form_state) {
$message = t('submitted');
drupal_set_message($message);
}
Also the submit hook doesn't fire when I click the button!
Any ideas?
Last edited by davidj; 06-15-2010 at 11:52 AM..
|