View Single Post
  #5 (permalink)  
Old 04-10-2008, 11:43 AM
Lius Lius is offline
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default

Quote:
Originally Posted by greboguru View Post
Code:
 
   var $form = array(
       'action'   => '/myswr/site/admin/login',
       'method'   => 'post',
       'elements' => array(
           'username' => array('text', array(
               'validators' => array(
                   array('alnum', array('message' => '%s must be alphanumeric!')),
                   array('regex', false, array('/^[a-z]/i')),
                   array('stringLength', false, array(3, 20,
                                          'message' => array(
                                          	Zend_Validate_StringLength::TOO_SHORT => '%s must be at least %min% characters.',
                                          	Zend_Validate_StringLength::TOO_LONG => '%s must be shorter than %max% characters.'))
                   )
               ),
               'required' => true,
               'filters'  => array('StringToLower')
           )),
           'password' => array('password', array(
               'validators' => array(
                   array('stringLength', false, array(3))
               ),
               'required' => true,
           )),
           'submit' => 'submit',
       ),
   );
I think the array key for custom validation messages is not 'message' but rather 'messages'
Reply With Quote