Re: DB_Table, entering default date, while maintaining qf_type = 'date'?
| From: | Mark Wiesemann | Date: | Sun, 15 Oct 2006 08:38:17 +0000 |
| Subject: | Re: DB_Table, entering default date, while maintaining qf_type = 'date'? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25449@lists.php.net to get a copy of this message | ||
Hi Llyod,
> In the $cols definition, I assign the date.
>
> However the date on the generated form becomes a text box,
> not the normal date entry field.
>
> i.e. it changes from 'qf_type' = 'date' to 'qf_type' =
> 'text'
I can't really follow you here (what do you mean by "it changes"?), but
it seems that the problem seems to be the following:
> I would like to be able to assign the default date (to today), while
> maintaining the date entry field style.
[...]
> // setup what to display.
> $cols = array(
> 'name' => '',
> 'address' => '',
> 'phone' => '',
> 'email' => '',
> 'date' => date('Y-m-d') // trying to figure out how to have
> today's
> date as the default data
> );
You need to use
'date' => array('Y' => date('Y'), 'm' =>
date('m'), 'd' => date('d'))
here; it's the right way to set default values for date fields in QF.
Regards,
Mark