You are not logged in.
We're going to take what was put together in the last 3 videos and now include some server-side validation that will appear asynchronously. This is an example of using Zend_Form as a validation tool via JSON.
Grab a copy of the project or browse the repository.
Enjoy!
Offline
Thank for this great tutorial (again ;-) )
Just a little question, is it on purpose* that you prefer to not use ZendX_JQuery_View_Helper to integrate JQuery to your application or is it just for make this tutorial more easy/valuable/extendable...
*I mean is there some backward (performance or whatever) when using ZendX_JQuery.
Last edited by T_bo (2010-04-15 09:29:41)
Offline
Hey T_bo, its partially because I haven't used it myself and also that it's currently sitting in ZendX. If you have ZendX in your library / include path, then its a great way to go. Another thing I'd like to mention is that I've found frameworks that try and limit your javascript to merely server-side generated code have the same shortcomings as the WYSIWYG editors... they often abstract away the advantages of the language in question.
ZendX_JQuery strikes a nice balance, however I'm not sold on completely letting Zend writing my Javascript code...
Offline
Hi !
I've made a similar functionality, so I have some details to add...
- Don't forget to test the type of the input. All fields are not testable (passwords, hidden...)
- If you use tokens, your ajax validation should instantiate a form without token, it shouldn't be regenerated !
- Externalise this in an ajax controller, it'll be more reusable. You have just to add the form name in data to instantiate it !
Thanks Jon, parts of your code are better than mine, i'll change it immediately !
Last edited by martinsupiot (2010-05-23 10:08:19)
Offline
Hi Guys,
I loved the tutorial, very very usefull...especially for someone like me that is just starting to learn the zend framework.
I have a question, and i will be grate if someone could help me to figure out a good answer (anyway I'm talking with experts, than i not have doubt that the answer will arrive:)).
I built a form (using zend form, and all the suggestions that i found very usefull in all the tutorial that i saw until now).
Now this form have also ajaxification..that works pretty well.
Now what I want to do is be able to manage my ajax function (jquery) using the message of errors that come from the zend structure.
In other words, I'd like to create a function (php) that will take as parameter two variable: $status (that can be 0 if the zend form validate bring errors, and 1 when everything is ok and we can just continue the registration process), and $txt( that will carry exactly the error message that come from zend,in other words what i can take with the getmessage(), or if there are not error will just bring a jump to the next page(the registration is done)).
In this way, if i pass to the jquery function that handle the ajax call, the parameter txt or status, i can controll the way in which the div that i create to show the errors, can be hidden or not.
How i can realize such type of function in zend? I done already in php, but not using zend framework, what i can't figure out is how i can create a msg function that show the errors as i said before (msg($status,$txt))?
There is a way to access to the errors array in zend, and build a custom error class that will create this msg function?
What i'm trying to do, is to be able to do something like in the facebook registration form.
Some suggetsions??
thanks so much
TT
Offline