Hi every:
I have a form created using the task propel-build:forms and look like this:

class BaseModlicCategoriasForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_categoria'     => new sfWidgetFormInputHidden(),
      'titulo_categoria' => new sfWidgetFormInput(),
      'activa'           => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_categoria'     => new sfValidatorPropelChoice(array('model' => 
'ModlicCategorias', 'column' => 'id_categoria', 'required' => false)),
      'titulo_categoria' => new sfValidatorString(array('max_length' => 150)),
      'activa'           => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('modlic_categorias[%s]');
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    parent::setup();
  }

  public function getModelName()
  {
    return 'ModlicCategorias';
  }
}

The using the other class I setup some Validators:

class ModlicCategoriasForm extends BaseModlicCategoriasForm
{
        public function configure()
        {
                unset  (
                $this['id_categoria']
                );
                $this->setValidators(array(
        'titulo_categoria' => new sfValidatorString(array(
                'required'=>true,
                'min_length'=>4,
                'max_length'=>25,
                ),array(
                'required'=>'The field is required',
                'min_length'=>'The field must have at least %min_length% 
characters',
                'max_length'=>'The field must not exceed %max_length% 
characters'
                ))));
        }
}

But when I check the checkbox and send the form I get this error:
Unexpected extra form field named "activa".

How can I fix this problem?

Cheers and thanks in advance
Ing. Reynier Pérez Mira
Grupo de Soporte al Desarrollo - Dirección Técnica IP 


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