Re: QF: Optional Passwords & Comparison
| From: | Bertrand Mansion | Date: | Wed, 23 Jun 2004 20:50:45 +0000 |
| Subject: | Re: QF: Optional Passwords & Comparison | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13290@lists.php.net to get a copy of this message | ||
Mark Drago wrote:
>Hello,
>
>I'm trying to create two password boxes that will be used for entering a
>password and for verifying that password. The problem I'm having arises
>due to the fact that in this application setting a password is
>optional. However, if the user enters text into _either_ text box, I
>want to throw an error in the case that they don't match (even if the
>other box is empty). I'm using the compare rule to check that they are
>the same, but I need it to be checked even if one of them is empty. I'm
>not sure how to go about this because they are not required. If a
>password had to be set, I would just set it to be required and move on,
>but the password is optional.
Did you try using the compare rule only ?
I mean, without the required rule. If an element is not required, the rule it is
assigned won't be triggered unless it is not empty. That's in the manual.
Bertrand Mansion
Mamasam