I'm new in Zend Framework, and I'm having a problem. usually when verifying data in forms we use javascript like bellow:
<html> <head> <script> function verify(){ if( document.form.name.value=="") { alert("Error"); return false} } </script> </head> <body> <form onSubmit="verify()" name="form"> <input name="name" /> <input type="submit" /> </form> </body> </html> I'm using zend forms and i don't have a clue how to do it.
<?php class Application_Form_Login extends Zend_Form { public function init() { $login = new Zend_Form_Element_Text('login'); $password = new Zend_Form_Element_Password('password'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel("Login"); $remember = new Zend_Form_Element_Checkbox('remember'); $this->addElements(array($login, $password,$remember ,$submit)); } } ?> Any help please.
thanks for any help.