If your after a calendar, you can just use
Code: Select all
<?php echo JHTML::_('calendar', $this->row->created, 'created', 'created', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
this will echo out a input filed and the DHTML date selector.
If you prefer to merge post data from 3 input fields you could intercept the post values right before the "store" function in your model.
So lets say your 3 Drop Downs are "day", "month", "year" and you want to bind them to a database field called "joined_date"
Code: Select all
function store($data)
{
$row =& $this->getTable('default');
//-- merge the posted date drop down fields and assign to joined_date
$data = JRequest::get( 'post' );
$data['joined_date'] = $data['day'] . $data['month'] . $data['year'];
//-- now the general bind functions in Joomla
//-- Bind the form fields to the table
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// if new item, order last in appropriate group
if (!$row->id) {
$where = 'catid = ' . (int) $row->catid ;
$row->ordering = $row->getNextOrder( $where );
}
// Make sure the table is valid
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the web link table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return true;
}
If someone has a more efficient way, be sure to let me know