Re: Help with PEAR:QuickForm Date
| From: | Kieran Kelly | Date: | Fri, 12 Mar 2004 10:08:09 +0000 |
| Subject: | Re: Help with PEAR:QuickForm Date | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11251@lists.php.net to get a copy of this message | ||
Sorry about that, I should have given more code.
$myForm = new HTML_QuickForm('Shares','get');
$myForm->addElement('header','', 'Get Start and End Dates');
$options = array(
'language' => 'en',
'format' => 'dMY',
'minYear' => 1990,
'maxYear' => 2005
);
$myForm->addElement('date','startDate','Date to start',$options);
$myForm->addElement('date','endDate','Date to end',$options);
$myForm->addElement('submit','submitButton','Submit data');
if ( $myForm->validate())
{
print 'Thank you! Your data is as follows:';
$myForm->removeElement('submitButton');
//$myForm->process('process_data', false);
$myForm->freeze();
}
$myForm->display();
$var1 = $startDate;
$getTest = $myForm->exportValue('startDate');
echo '<p>please ' . $getTest[0][0][1];
Hopfeully this is what u wanted. Thanks for the prompt response.
Kieran
----- Original Message -----
From: "Alexey Borzov" <borz_off@cs.msu.su>
To: "Kieran Kelly" <kkelly@elipsan.com>
Cc: <pear-general@lists.php.net>
Sent: Thursday, March 11, 2004 8:50 PM
Subject: Re: [PEAR] Help with PEAR:QuickForm Date
> Hi!
>
> Kieran Kelly wrote:
> > I'm new to PHP and PEAR and I'm setting up a simple form to read in some dates.
> > The problem is that I now want to extract the day/month/year from the form and assign them to
> > variables in my script.
> >
> > So the date is read in thru the following:
> > $myForm->addElement('date','startDate','Date to
> > start',$options);
> >
> > How do I get the information from startDate??? I tried below and other variants, but
> > I'm unable to extract the day/month/year that was entered on my form. I'm not sure what
> > format the startDate is in!
>
> Neither are we, the format is defined in $options, but you didn't post its value.
>
> > $getTest = $myForm->exportValue('startDate');
>
>
>
>