Re: stumped - required note is not displayed in group - solved
| From: | Greg Beaver | Date: | Thu, 06 Nov 2003 05:04:41 +0000 |
| Subject: | Re: stumped - required note is not displayed in group - solved | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8802@lists.php.net to get a copy of this message | ||
I solved my own problem, needed to enclose the rule in another array(). Sorry for the extra noise.
Greg
Greg Beaver wrote:
Hi, Can someone point out the obvious error I'm missing in: <?php ... $zip = array(); $zip[] = &HTML_QuickForm::createElement('text', 'zip5', 'Zip', array('size' => 5)); $zip[] = &HTML_QuickForm::createElement('text', 'zip4', 'Zip+4', array('size' => 4)); $form->addElement('group', 'zip', 'Zip Code:', $zip, '-'); $form->addGroupRule('zip', array('zip5' => array('Zip Code Required', 'required'))); ?> I am using the default renderer, v3.2, and neither a red * or the required note is displayed at any time. My foray through the code has not found any obvious bugs either, so I assume there is a problem on my end. Any help is appreciated. The code should display a US zip code, 1 text box with 5 spaces, a hyphen, and another box with the zip+4. I want the 5-digit zip code to be required, and the 4-digit zip+4 to be optional. Regards, Greg