Hi everyone !

I would like to confirm a username and password in a form (have 2
widget for the username, and 2 for the password, and test the
equality):

                $this->useFields(array('username', 'password', 
'profession_id'));

                $this->widgetSchema['confirmation_username'] = new
sfWidgetFormInputText();
                $this->widgetSchema['confirmation_password'] = new
sfWidgetFormInputPassword();
                $this->widgetSchema['password'] = new 
sfWidgetFormInputPassword();
                $this->widgetSchema['profession_id'] = new 
sfWidgetFormDoctrineChoice
(array('model' => $this->getRelatedModelName('Profession'),
'add_empty' => false, 'multiple' => false, 'expanded' => true));

                $this->validatorSchema['confirmation_password'] = clone $this-
>validatorSchema['password'];
                $this->mergePostValidator(new 
sfValidatorSchemaCompare('username',
sfValidatorSchemaCompare::EQUAL, 'confirmation_username', array(),
array('invalid' => 'Les deux emails doivent ĂȘtre identiques.')));
                $this->mergePostValidator(new 
sfValidatorSchemaCompare('password',
sfValidatorSchemaCompare::EQUAL, 'confirmation_password', array(),
array('invalid' => 'Les deux mots de passe doivent ĂȘtre
identiques.')));

                $this->widgetSchema->moveField('confirmation_username', 'after',
'username');
                $this->widgetSchema->moveField('confirmation_password', 'after',
'password');



but the symfony form doesn't accept another extra field, the error is:

Unexpected extra form field named "confirmation_username".

how to do what I want ?

thanks
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to