Re: QuickForm Date Values
| From: | Bertrand Mansion | Date: | Mon, 07 Apr 2003 16:16:53 +0000 |
| Subject: | Re: QuickForm Date Values | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4682@lists.php.net to get a copy of this message | ||
<whovind@web-sters.com> wrote :
> Hello
>
> Assuming I have the following declaration:
>
> $form->addElement('date', 'birthDate', 'Birthdate:',
> array('format'=>'d-M-Y',
>
> 'language'=>'en','minYear'=>'1900','maxYear'=>'2003'));
>
> How do I access the data after the form has been validated? I've tried MANY
> different combinations of getSubmitValues and the closest I can get is the
> raw array values.
Hi Wade,
If you use this format: 'd-M-Y', this will create 3 select boxes
respectively called birthDate[d], birthDate[M], birthDate[Y]. You can access
these values with $values = $form->getSubmitValues() and
$values['birthDate']['d'], $values['birthDate']['M'],
$values['birthDate']['Y']. Then, it's up to you to convert this array to
the
format you want using the PHP date() function.
Bertrand Mansion
Mamasam