QuickForm rule needs other submittedValues
| From: | Wolfram Kriesing | Date: | Thu, 22 May 2003 15:45:10 +0000 |
| Subject: | QuickForm rule needs other submittedValues | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5550@lists.php.net to get a copy of this message | ||
i have written a rule, which i register using registerRule().
This rules checks if the email is unique. But what i need for this to properly do the work is the ID, which is another one of the submitted values. But as i see it i have no chance to access any other data of the form from within my rule-function. Or is there a way?
this is my rule-function.
function isEmailUnique($email)
{
$user =& new Dao_User();
$user->setWhere('LOWER(email)='.$email);
$user->addWhere('id<>'.????user-ID????);
return $user->getCount()>0?false:true;
}
here i need access to other submitted values. is that possible? or how do i do it best?
--
Wolfram
... opensource @ vision:produktion ...
http://opensource.visionp.de
... translating template engine ....
http://sf.net/projects/simpletpl
... authentication system ....
http://sf.net/projects/auth