I must create my own 3. error communicates for field - 'name' - in Symfony
Framework it would be:
$this->setValidators(array(
          'name' => new sfValidatorString(array('min_length' => 2, 'max_length' 
=>
50, 'trim' => true), 
          array('required' => 'Name is required.', 'min_length' => 'Name is too
short.', 'max_length' => 'Name is too long.'))
    ));

In Zend Framework I have:
$this->addElement('text', 'name', array(
            'label'      => 'Name:',
            'required'   => true,
            'filters'    => array('StripTags', 'StringTrim'), 
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(2,
50)),
            )
        ));

How can I add these 3. error communicates to that field above ??
Error communicates:
- Name is required.
- Name is too short.
- Name is too long.

-- 
View this message in context: 
http://www.nabble.com/error-messages-in-form-tp25524216p25524216.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to