By hhaidoura on
In my module I want to alter the search form by adding more extra fields to it, the problem is that I dont know where I should start working on the next step after I modify the form.
using drupal api module_form_alter($form_id , &$form)
I added my extra date field to the form, like following
function module_form_alter($form_id, &$form) {
//date fields
$newform = array()
$newform['advancedsearch']['from_date'] = array(
'#title' => t('From Date'),
'#type' => 'date',
'#description' => t('Search From this Date.'),
'#default_value' => array(
'month' => format_date(time(), 'custom', 'n'),
'day' => format_date(time(), 'custom', 'j'),
'year' => format_date(time(), 'custom', 'Y')
)
);
$form = array_merge($form, $newform );
}
I assume that the next step is in the validate function then to the submit function.
What is the correct submit function that i should be calling inorder to handle the new date variable with the search action.