Great thanks for all your responses,
In fact i follow the solution of bedomon, i create a
sfValidatorCallback in my form like that

   $this->validatorSchema['MyField'] = new
sfValidatorCallback(array('callback' => array($this, 'validateMhq')));

and i add this function :

  public function validateMhq(sfValidatorBase $validator, $value)
  {
$site = sfContext::getInstance()->getUser()->getProfile()->getSite();
$param = Doctrine_Core::getTable('Param')->findOneBySiteId($site);
    if ( $value > $param->getMhq())
    {
      throw new sfValidatorError($validator, 'Value is greater than
Mhq');
    }
    else {
        return $value;
        }
  }

It works !, so thanks again bedomon. In fact i think that the solution
of Ken is a good idea.

On 23 déc, 20:54, ken <marfillas...@gmail.com> wrote:
> you can simply pass the min number as a form option then pass as "min"
> option ofhttp://www.symfony-project.org/api/1_4/sfValidatorNumber

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