Quickform rules
| From: | Florian van Eerd | Date: | Mon, 04 Aug 2008 13:16:02 +0000 |
| Subject: | Quickform rules | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-29133@lists.php.net to get a copy of this message | ||
Hi folks!
I don't know why, but this doesn't work:
$form->addElement("text", "surname", "$_0103:",
array('size' => 50,
'maxlength' => 255, 'value' => $surname));
$form->applyFilter('surname', 'trim');
$form->addRule('surname', 'Please enter 'surname',
'required', null,
'client');
$form->addRule('surname', 'Last name must not be longer than 20
characters', 'maxlength', 20);
The Filter for 'required' works perfectly fine. But I can enter as many
characters as I want to, without raising an error...
What do I do wrong?