Haven't really worked with any of the JS library form validations.
Will try to do so in the next couple of months to understand how they
work.
Initially I just thought that we could do something reasonably simple like this:

 -Having a function getJsValidation() for each of the validators that
returns the JS equivalent of what the validator is doing on the server
side (e.g. checks for not empty and makes sure it's all numeric).
 -Having a function in Zend_Form that returns all validations in one
JS function that is called by onsubmit (or something similar).

I am aware that JS form validation is a PITA. I would like to avoid
having to write the validation requirements twice (once for ZF and
then for my favourite JS library (or manually if I don't want to use a
library). Will have a look into those JS libraries when time permits
to see if I could come up with a suggestion on how to allow Zend_Form
to generate the code for the library. This way we might be able to
provide a code generation for the JS validation for at least the most
popular JS libraries.



On Dec 3, 2007 2:36 PM, Simon Mundy <[EMAIL PROTECTED]> wrote:
>
> My preference would be to provide hooks for JS validation only. I prefer
> using MooTools as my JS library, but there's no doubt many would prefer
> JQuery, Script.aculo.us or many other flavours. Adding ZF-specific
> JavaScripts would be IMO a waste of time.

Reply via email to