View Single Post
  #1 (permalink)  
Old 03-28-2008, 12:15 PM
mamyte03 mamyte03 is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Default Form Validator message

Hello,

I am new in ZF and have some question :
I have a form :
Code:
public static function Login()
	{
	 	require_once 'Zend/Form.php';
	 	
	 	$LoginForm = new Zend_Form(
    	array( 
        'method'   => 'post', 
        'elements' => array( 
            'LoginName' => array('text', array( 
                'required' => true, 
                'label' => 'Prisijungimo vardas' 
            )),
            'Pass' => array('text', array( 
                'required' => true, 
                'label' => 'Slaptažodis' 
            )),  
            'submit' => array('submit', array( 
                'label' => 'Prisijungti' 
            )) 
        ), 
    ));
    return $LoginForm; 
	 	
	}
and view
Code:
$form=$this->Login();
    	
    	if ($this->getRequest()->isPost())
    	{   
    		 
    		if ($form->isValid($_POST))
    		{
    			$values = $form->getValues();   
		}
			/*else
			{
				$form->populate($_POST);	
			}*/
			
		}
    	$this->view->form = $form;
Now if textfield are empty write default message.
How can I change this message, without creating a new class who extends Zend_Validate_Abstract?
Reply With Quote