Validation library PHP / Javascript
could someone recommend a PHP form validation library (that works independently outside of any php framework) that apart from doing all sort of basic validation (is empty, vs regex, is email, is alphanumeric and so on) can produce javascript code (ideally to work with jquery) to validate the very same form with the very same rules client-side and hence defi开发者_如何学Gone validation rules in a single place and have a form validated both server and client side?
Thanks.
The Nette framework does this: http://doc.nette.org/en/forms
The whole form and the validation rules are defined in a PHP file. The framework then generates HTML code with javascript validation and after submitting it performs the server-side validation.
You can even use the Forms part of the framework separately.
Please visit www.phpclasses.org. There should be many validation classes. You can extend them as per your requirement.
精彩评论