For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > Pear QuickForm date element causing problems









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pear QuickForm date element causing problems
Sam Miller

2004-08-09, 8:56 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com