Re: QF and null in date elements

From: Date: Wed, 28 Jan 2004 17:44:57 +0000
Subject: Re: QF and null in date elements
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10411@lists.php.net to get a copy of this message
Hi Thanks for your advise. This would be a anwser to this problem, but not satisfying in every case. The user should have the opportunity to change from null to e real date if he want this..... I only see the way to make a own date element with new entries in every pop up with null values. But whats the simplest way to do this.? Marco ----- Original Message ----- From: "Mike Carter" <mike.carter@personalmedicaladvisor.co.uk> To: <kundert@mysunrise.ch>; <pear-general@lists.php.net> Sent: Wednesday, January 28, 2004 5:34 PM Subject: RE: [PEAR] QF and null in date elements > > > > -----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. >

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