Naneu did something very nice as I think
(http://naneau.nl/playground/formvalidate/)...
This should be the right way (as many others already said) - simply support
nothing for javascript.
It's enough to make the Zend_Form JSON compatible.
For example:
validateJSONAction() {
$form = new Zend_Form(); // ...
$form->populateFromJson($this->getRequest()->getParam('formvalues');
// send via Ajax from the form
if($form->isValid()) {
// isValid json string
} else {
// display erros as json
}
}
Than simply Js has to put the errors in a <div> or submit the form if there
aren't any errors.
If we build the ZF on other libraries, I think the idependence for every
developer will be lost.
Maybe later, we could write some adapter/viewhelper, which (dependent on the
library) build an formobserver which creates the Ajax request.
The rest should be done by each developer, not by ZF!
Best regards
--
View this message in context:
http://www.nabble.com/Zend_Form-tf4719410s16154.html#a14145957
Sent from the Zend Framework mailing list archive at Nabble.com.