Re: quickform, validation of date element

From: Date: Wed, 03 Aug 2005 19:20:08 +0000
Subject: Re: quickform, validation of date element
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20244@lists.php.net to get a copy of this message
Thanks 2005/8/1, Alexey Borzov <borz_off@cs.msu.su>: > Hi, > > Julien Tschäppät wrote: > > I tried to do something with the example of the doc. I managed to get > > a javascript box when a date is not given. But even if it's given the > > box is displayed. > > > > My test script : > > > > $form = new HTML_QuickForm('test', 'post'); > > > > $test[] = &HTML_QuickForm::createElement('date', 'testDate', > > 'Date: ', > > array('addEmptyOption' => true)); > > $form->addGroup($test, 'testGroup', 'Date :'); > > $form->addGroupRule('testGroup', 'Date required', > > 'required', null, > > null, 'client'); > > You got it all wrong. You don't need to put date element into group since date > element is a group itself, therefore: > > $form->addElement('date', 'testDate', 'Date: ', > array('addEmptyOption' => true)); > $form->addGroupRule('testDate', 'Date required', 'required', > null, null, 'client'); > >

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