thanx for the reply david.. but that is not what i need.. i want to use the "sfValidatorDoctrineUnique" validator for username field. and at the same time i also want that one user can edit his/her user name.. so at the time of edit the user.. when one submits without changing the username it will throw the error for "Username already exist.".. which means that the same recording is validating itself..
On Oct 30, 5:25 pm, David Ashwood <[email protected]> wrote: > In your form class you'll need something like: > > public function configure() { > parent::configure(); > > // Common Validation > if ($this->isNew) { > // extra validation for new objects > } else { > // extra validation for existing objects > } > } > > On Fri, 2009-10-30 at 03:44 -0700, ravi wrote: > > Hello everyone, > > > I am using sfValidatorDoctrineUnique to validate unique username and > > i am going to implement to edit the "username". so at the time when > > form comes to edit the user and if i will not change the username then > > also it gives me the error for uniquenes.. if any one know how to skip > > a single record for sfValidatorDoctrineUnique while editing the form. > > for example.. > > user:- ravi > > pass:- ravi > > > and if am going to edit the user then without changing username if > > press save button then it will validate the the value "ravi" with my > > own value "ravi" and throws error.. so is there any way to compare the > > newly updated record with all records except the "edited one.."... > > > thanx in advance.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
