Put the required option on the sfValidatorAnd, e.g.:

'title' => new sfValidatorAnd(
array(
  new sfValidatorCallback(array('callback' => array($this, 'stripTags'))),
  new sfValidatorString(array('max_length' => 50))
)
, array('required' => false)
)

On Wed, Feb 10, 2010 at 1:33 AM, Hong Kil Dong <[email protected]> wrote:
> I face with such a problem - sfValidatorAnd completely ignores
> 'required' settings of its components.
>
> As an examle, for such a field:
>
> 'title' => new sfWidgetFormInput()
> ...
> 'title' => new sfValidatorAnd(
> array(
> new sfValidatorCallback(array('required' => false, 'callback' =>
> array($this, 'stripTags'))),
> new sfValidatorString(array('required' => false, 'max_length' => 50))
> ))
>
> it generates "Required." validation error. How can I get rid of this
> error ?
>
> --
> 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.
>
>



-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

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