RE: [PEAR] QuickForm validation
| From: | Mike Carter | Date: | Tue, 13 Apr 2004 10:58:05 +0000 |
| Subject: | RE: [PEAR] QuickForm validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11814@lists.php.net to get a copy of this message | ||
Hi,
> -----Original Message-----
> From: Sagi Bashari [mailto:sagi@boom.org.il]
>
> 1. Is it possible to make the select element automatically
> validate that
> a value is part of $options?
Would the select element only list things in the $options array provided to
it anyway?
> 2. How can I validate if a value is in a specific numrange? I've seen
> such class in the rules-custom.php example but shouldn't such a basic
> validation be part of the normal package?
I asked the very same question a while back. The reason it is in the custom
rules example code is because the developers could not think of another
example rule to develop and provide as an example.
All I did was add the following line before creating my Quickform.
HTML_QuickForm::registerRule('NumericRange', null,
'HTML_QuickForm_Rule_NumericRange',
'Lib/Extension/QuickForm/Rule/NumericRange.php');
This made the rule available to my forms.
Regards,
Mike C.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________