Re: Help with PEAR:QuickForm Date

From: Date: Fri, 12 Mar 2004 13:28:29 +0000
Subject: Re: Help with PEAR:QuickForm Date
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11257@lists.php.net to get a copy of this message
Hi Again, I've being doing a bit of investigation and from your comments about the format, realised that the Day = startDate[d] Month =startDate[M] Year=startDate[Y] But when I put this into practise in the line: $getTest = $myForm->exportValue('startDate[d]'); echo $getTest I just get 'Object' printed out on screen. Due to my lack of understanding on how the data is stored I'm unable to give exportValue the correct parameter. Just thought I'd add this in. ----- Original Message ----- From: "Kieran Kelly" <kkelly@elipsan.com> To: "Alexey Borzov" <borz_off@cs.msu.su> Cc: <pear-general@lists.php.net> Sent: Friday, March 12, 2004 10:08 AM Subject: Re: [PEAR] Help with PEAR:QuickForm Date 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'); > > > >

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