|
|||
|
Hi,
Can anyone tell me if I can make use of Zend_Validate classes if I am not using Zend_Form to handle the forms? It would be nice if you could give some examples too... Moreover, if I am not using Zend_Form in mvc how do I handle the forms (where smarty template is used)? Please help.. ~Nwim |
|
|||
|
|
|
|||
|
hi nwim,
form handling doesn't need to be acomplished by Zend_Form and it doesn't matter what templating system you're using (either Zend_View or Smarty, etc.). all you need to do is eg.: PHP Code:
Read more on zend framework's manual on official site ![]() Last edited by kuba : 05-11-2008 at 11:57 AM. |
|
|||
|
Hi Kuba,
Thanks a lot for the info and the sample code. It was great help. I used your sample code for validating username filed in my registration form. I just added the following line $this->view->title = "Submit Success"; just before the $request = $this->getRequest();....rest of the codes are same as the sample code. But, the validation did not occur. Whether I enter or do not enter any data in the username field, it does not give any error and takes me to the Add Success page. I think I am missing something here...Could you please help me with this? ~Nwim |
|
|||
|
it works fine for me
:Pindex.phtml: HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Insert title here</title> </head> <body> <?=$this->errors['username']; ?> <form action="" method="post"> <input type="text" name="username" /> </form> </body> </html> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|