That "I'm not sure i understand you" was for Alexandre ...

@HAUSa: this was the same problem i had and the code i wrote in my
first post did it for me ...

Michael

On 23 Okt., 15:04, HAUSa <[email protected]>
wrote:
> Exactly. I want to be 100% sure that one language is completed. But
> the user may choose for himself if he wants to make his content
> available in other languages.
>
> On 23 okt, 14:44, "[email protected]"
>
>
>
> <[email protected]> wrote:
> > I'm not sure i understand you ...
>
> > This works for me when i want the 'name' field in my i18n form to be
> > 'required', but only for the 'en' language (in this example). So if i
> > have 3 cultures and submit the main form, i get an error beside the
> > empty 'name' widget, but only for the specified language.
>
> > On 23 Okt., 13:36, Alexandre SALOME <[email protected]>
> > wrote:
>
> > > Well, i think you mean : "fill all the required, or none" ?
>
> > > Because this is good for en, but what if 2 objects of the same class does
> > > not fill the same language...
>
> > > 2009/10/23 [email protected] <[email protected]>
>
> > > > I solved it this way:
> > > > In your form configure method (i18n form):
>
> > > > /* set required if object culture is 'en' */
> > > > $required = ($this->getObject()->getCulture() === 'en') ? true :
> > > > false;
>
> > > > $this->setValidators(array(
> > > >      'name'    => new sfValidatorString(array('required' =>
> > > > $required)),
> > > > ));
>
> > > > Hope this helps ...
> > > > Michael
>
> > > > On 23 Okt., 10:49, HAUSa <[email protected]>
> > > > wrote:
> > > > > In my ObjectI18nForm I made several fields required.
> > > > > I embedded the ObjectI18nForm for two languages in my ObjectForm.
>
> > > > > Ofcourse, in both languages the fields are required. But I want my
> > > > > user to be able to submit only one language, he / she is not required
> > > > > to complete the fields for both languages.
>
> > > > > Anyone who knows how I can handle this?
>
> > > --
> > > Alexandre Salomé -- [email protected]
--~--~---------~--~----~------------~-------~--~----~
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