Re: QF or FB: how to allow a NULL for date field?

From: Date: Fri, 07 Jan 2005 21:28:32 +0000
Subject: Re: QF or FB: how to allow a NULL for date field?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16804@lists.php.net to get a copy of this message
On Fri, 7 Jan 2005 12:27:12 -0800 (PST), l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > I have several forms where that track status of a process. I have been building the forms > based on using a date field - if datefiled = '0000-00-00' //default for database field, > then that status has not happened yet. > > However, when using either QuickForm or FormBuilder, the date field is generated in such a way > that it will always enter a date in the field. > > OPTION 1 - figure out a way around this. > > OPTION 2 - restructure my tables to add an additional field (Yes/No) to track each status. > > Your thoughts? > Do you allow "null" in the date fields? Try putting the date field in fb_selectAddEmpty. If that doesn't work you can also use preProcessForm to check for a "null" date and either set it to "0000-00-00" or DB_DataObject_Cast::sql('NULL'); -- Justin Patrin

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