Re: Pear QuickForm date element causing problems
| From: | Bertrand Mansion | Date: | Tue, 10 Aug 2004 10:27:15 +0000 |
| Subject: | Re: Pear QuickForm date element causing problems | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14049@lists.php.net to get a copy of this message | ||
Sam Miller wrote:
>Thanks for your reply. I am also using other date fields where the
>format is not 'Y Y'. For example there's the following code:
>
>$options = array(
> 'language' => 'en',
> 'format' => 'dMYHi',
> 'addEmptyOption' => TRUE,
> 'minYear' => 2001,
> 'maxYear' => 2005,
> );
>
> $this->addElement('date', 'mydate', 'Choose
> date',$options);
>
>It's the same problem here. QuickForm adds an empty option but it is
>added at the end of the select field and is not selected by default.
Obviously, the problem is somewhere in your code unless you can report that the following does not
work and send a real reproduce code :
<?php
require_once 'HTML/QuickForm.php';
$options = array(
'language' => 'en',
'format' => 'dMYHi',
'addEmptyOption' => TRUE,
'minYear' => 2001,
'maxYear' => 2005
);
$form = new HTML_QuickForm();
$form->addElement('date', 'mydate', 'Choose date',$options);
$form->addElement('submit', 'submit', 'submit');
$form->display();
?>
Bertrand Mansion
Mamasam