Hi,

In a single form, user has to select or create a new record.

The first field correspond to the choice (radio) :
- existing
- new

My issue is about validation: I need to apply the good schema  
depending on choice value :
- If user select "existing", he just has to select a value in a select.
- If user select "new", he has to fill many fields.

I'm running arround embedding 2 forms and rewriting the isValid()  
method like :
  public function isValid()
  {
    if ($this->taintedValues['new'] == self::NEW)
    {
      return $this->formNew->isValid();
    }
    else
    {
      return $this->formExisting->isValid();
    }
  }

It's working but I'm searching for a better practice.

Thanks for your advises.
--
Nicolas CHARLOT
http://www.isics.fr




--~--~---------~--~----~------------~-------~--~----~
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