RE: [PEAR] QF and null in date elements
| From: | Mike Carter | Date: | Wed, 28 Jan 2004 16:34:06 +0000 |
| Subject: | RE: [PEAR] QF and null in date elements | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10406@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: kundert@mysunrise.ch [mailto:kundert@mysunrise.ch]
>
> I'v got a Problem with QF. I use the form to update records
> in the db. If I load the form, I set the defaultvalues with
> values from the db ($form->setDefaults($defaultValues);).
> Among other elements, i have date elements like
> $form->addElement('date', 'frm_lieferdatum',
> get_page_item('frm_futter_lieferdatum'),
> array('format'=>$frm_date_format, 'minYear'=>2000,
> 'maxYear'=>date('Y')+1));
>
> If the date value in the db field is null, QF comes in
> trouble. The three grouped elements (day,month,year) shows
> the min. possible date, in this case 1.1.2000. If the user
> press the save button, naturally the date 1.1.2000 will be
> saved and thats wrong. It should be still null!
> Does anyone have a solution for this problem?
Hide the date field if the value coming out of the database is null?
-Mike C.