Re: QuickForm dates

From: Date: Tue, 24 Jun 2003 01:08:22 +0000
Subject: Re: QuickForm dates
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6205@lists.php.net to get a copy of this message
Following-up to myself because I'm a big doofus -;^>= >> 2) If I want to use a regular text box for my date -- like below, how >> can I validate it as a date?? >> >> $form->addElement('text', 'dob', 'DoB'); >> $input = &$form->getElement('dob'); >> $input->setSize(15); >> $input->setMaxLength(15); Don't do this as a text field, do it as a date field; look at QuickForm_example.php, for stuff like this: // Date elements $form->addElement('date', 'dateTest1', 'Date1:', array('format'=>'dmY', 'minYear'=>2000, 'maxYear'=>2004)); $form->addElement('date', 'dateTest2', 'Date2:', array('format'=>'d-F-Y', 'language'=>'de')); $form->addElement('date', 'dateTest3', 'Today is:', array('format'=>'l D d M Y')); -- Doofus (a.k.a. mitchy)

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