Dates in QuickForm
| From: | php-gen | Date: | Mon, 01 Sep 2003 02:04:36 +0000 |
| Subject: | Dates in QuickForm | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7519@lists.php.net to get a copy of this message | ||
If you have created a form which includes the Date element, what is the best
way to set its default value from a MySQL statement?
Eg: select id, expiry_date from mytable where id = 1
with the date field being set up as
$options = array(
'language' => 'en',
'format' => 'dMY',
'minYear' => 1999,
'maxYear' => 2010
);
$form->addElement('date', 'expiry_date', 'Expiry Date:',
$options);
$form->addElement('hidden', 'id');
..
$form->setDefaults($user);
...
Cheers
Leonie