On Mon, 27 Jul 2009, septem wrote:

> How can I compare and validate that the user has not chose one
> language several times?
> Each language is embedded in a languages form, which is embedded in
> the main form.
> Language has columns 'member_id' (which is unset) and 'language_id'.
> I need to compare and validate 'language_id'.
> 
> $lang_forms = new sfForm();
> foreach ($nv_member->getNvMemberLanguages() as $pos=>$lang) {
>  $lang_form = new NvMemberLanguageForm($lang);
>  unset($lang_form['member_id']);
>  $lang_forms->embedForm($pos, $lang_form);
> }
> $this->embedForm('languages', $lang_forms);

You can set the validator in the configure() method of the embedded form. 
You can use sfValidatorChoice or sfValidatorPropelChoice.



-- 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@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