Pear QuickForm date element causing problems

From: Date: Mon, 09 Aug 2004 22:32:05 +0000
Subject: Pear QuickForm date element causing problems
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14031@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

« previous php.pear.general (#14031) next »