stumped - required note is not displayed in group
| From: | Greg Beaver | Date: | Thu, 06 Nov 2003 04:44:22 +0000 |
| Subject: | stumped - required note is not displayed in group | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8801@lists.php.net to get a copy of this message | ||
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