Hi,

Take a loot at sfValidatorCallback and validatorSchema post validation.

Cheers,


Before Printing, Think about Your Environmental Responsibility!
Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


On Tue, Feb 2, 2010 at 2:13 PM, jignesh patel
<jignesh.dadhan...@gmail.com>wrote:

> Hiii i am new to the symfony framework.
>
> I am having form with some widgets and respected validators.
>
> Now my question is how can i create validator which dependent on
> previous or any of the widgets values.
>
> I am having price text field and not_price checkbox, if i check check
> box not_priced price text field should not be mandatory for the form
> and if not checked price text field should be mandatory for the form.
>
> e.g
>
> $this->widgetSchema['price'] = new sfWidgetFormInputText();
> $this->validatorSchema['price'] =  new sfValidatorString(array
> ('required' => true));
>
> $this->widgetSchema['not_priced'] = new sfWidgetFormChoice(array
> ('choices' => array(1 => 'not priced'), 'expanded' => true, 'multiple'
> => true ));
>    $this->validatorSchema['not_priced'] =  new sfValidatorPass();
>
>
> Can anybody help me...
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>

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