Re: Quickform and dependent validation.

From: Date: Thu, 06 Feb 2003 13:19:09 +0000
Subject: Re: Quickform and dependent validation.
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3913@lists.php.net to get a copy of this message
Hello,
Did you try: $form->addRule('text1', 'is required.', 'required'); $form->addRule('text1', 'must be numeric.', 'numeric'); $form->addRule('text2', 'is required.', 'required'); $form->addRule('text2', 'must be numeric.', 'numeric');
If tried this, but then both fields must be filled. I am searching for a method, that only one of both fields has to be filled, not depending on field1 or field2.
Name    Value  Name    Value   Validate
text1 = value  text2 = null    true
text1 = null text2 = value true
text1 = null   text2 = null    false
In my real form, i ve got 10 textfields and this form should only be true, if one or more of these fields are filled and value is numeric. Tobias.

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