View Single Post
  #4 (permalink)  
Old 05-22-2008, 09:56 AM
Filip Filip is offline
Junior Member
 
Join Date: Apr 2008
Posts: 28
Default

I solved it this way.

NOTE: - $context['wachtwoordA] is the name of the first passwordfield
- $value is the value of the field which it is validating.
- This is the isValid method from my own custom validator

Code:
    public function isValid($value, $context = null)
    {
        $value = (string) $value;
        $this->_setValue($value);

      	  if (is_array($context))
      	   {
      	      if (isset($context['wachtwoordA'])
     	           && ($value == $context['wachtwoordA']))
     	       {
    	            return true;
    	       }
      	   }
          elseif (is_string($context) && ($value == $context))
           {
            return true;
           }
         
        $this->_error(self::NOT_MATCH);
        return false;
    }
Reply With Quote