I am having an issue with implementing a new custom element in my forms.
The element is to be a 'time' element that allows the user to input an hour, minute and am/pm from selection lists.
Most of my code comes from 'form_example_elements.inc' .What I have done so far is
In the .module file:
function gigmap_elements() {
return array('time' => array(
'#input' => TRUE,
)
);
}
function form_gigmap_element_info() {
require_once('form_gigmap_elements.inc');
return _form_gigmap_element_info();
}
function form_gigmap_theme($existing, $type, $theme, $path) {
require_once('form_gigmap_elements.inc');
return _form_gigmap_element_theme($existing, $type, $theme, $path);
}
and in the 'form_gigmap_elements.inc':
function _form_gigmap_element_info() {
$types['form_gigmap_time'] = array(
'#input' => TRUE,
'#process' => array('form_gigmap_time_process'),
'#element_validate' => array('form_gigmap_time_validate'),
'#autocomplete_path' => FALSE,
'#theme_wrappers' => array('form_gigmap_inline_form_element'),
);
return $types;
}
function form_gigmap_time_process($element, &$form_state, $complete_form) {
$i=0;
$hours = array(0 => '--'. t('Select') .'--');
while ($i < 12) {
$hours[$i] = $i;
$i++;
}
$i=0;
$minutes = array(0 => '--'. t('Select') .'--');
while ($i < 60) {