Use postvalidator in form class like this:
        $this->validatorSchema->setPostValidator(
            new sfValidatorAnd(
                array(
                    new sfValidatorPropelUnique(array('model' =>
'sfGuardUser', 'column' => array('username')), array("invalid" =>
"Such %column% is already exists")),
                    new sfValidatorPropelUnique(array('model' =>
'sfGuardUserProfile', 'column' => array('email')), array("invalid" =>
"Such %column% is already exists"))
                )
            )
        );


On Feb 18, 11:03 pm, Iltar <[email protected]> wrote:
> How can I add a validation for fields that have a unique index?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to