QuickForm date element not properly working
| From: | Sam Miller | Date: | Mon, 09 Aug 2004 22:28:46 +0000 |
| Subject: | QuickForm date element not properly working | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14030@lists.php.net to get a copy of this message | ||
Hi
I'm using PEAR's quickform. It is quite useful, but sometimes it also causes
major headaches. Well, my problem at the moment is that I can't get the date
element to work properly. My code is:
$this->addElement('date', 'Birthdate', 'Date of Birth',
array('language'=>strtolower($_SESSION['language']),
'format'=>'Y Y',
'minYear'=>date('Y')-30,
'maxYear'=>date('Y'),
'addEmptyOption' => TRUE)
);
This causes QuickForm to add an empty option to my list. But instead of
adding it on top of everything (as it is described in the documentation), it
adds the empty value at the bottom of my select fields. Also, the empty
values are not selected by default.
So how do I get QuickForm to add an empty option on top of all other values
and select it by default? (I'm using QuickForm 3.2)
Any help would be appreciated. Thanks a lot
Sam