$this->setValidators(array(

      'charge_type'            => new
sfValidatorChoice(array('choices' => array(0 => 'percent', 1 =>
'flat'), 'required' => false)),
      'upper_slab'             => new
sfValidatorNumber(array('min'=>0,'required' => false)),


    ));



   $this->validatorSchema->setPostValidator(
         new sfValidatorAnd(array(

               new
sfValidatorCallback(array('callback'=>array($this,'upperValidation'))),

        ))
   );


  public function upperValidation($validator, $values)
  {
        if($values['charge_type']=='percent') {

            if(empty($values['upper_slab']))
            {
               $error = new sfValidatorError($validator, "Upper Slab
Required");
               throw new sfValidatorErrorSchema($validator,
array('upper_slab' => $error));

            }


        }
        return $values;


   }


here i got message  "fasd" is not a number. Upper Slab Required .

i want to show here only "fasd" is not a number.

and when value is blank it will show Upper Slab Required .




-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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