In Symfony 1.4 Im using a form based on model. But there are some widgets/fields I must need to validate. I couldnt find removeWidget() or something like that, how to remove some fields not to be checked/validated?
EDIT: baseForm
$this->setWidgets(array(
'f1' => new sfWidgetFormInputHidden(),
'f2' => new sfWidgetFormInputText(),
'f3' => sfWidgetFormInputText()
));
$this->setValidators(array(
'f1' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ID')), 'empty_value' => $this->getObject()->get('ID'), 'required' => false)),
'f2' => new sfValidatorInteger(),
'f3' => new sfValidatorInteger()
));
$this->widgetSchema->setNameFormat('task[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
and now somehow I must edit the configure() method so that validator wont check ‘f1’ field.
You could simply unset the widget from the form