Re:Show HN: a small jQuery Form Validation library
by rgbrgb on Sunday November 04, 2012 @11:23AM
(#4740114)
I've been using this for a new rails app:
https://github.com/bcardarella/client_side_validations
It does basically what you describe, but once you combine it with some other gems and add in some non-standard validations, it seems to get a bit unwieldy. I'm newish to rails but it makes me pine for Node.js, where I could literally just run the same validations on the client and server. Do any rails gurus know if this is best practice?
Re:Show HN: a small jQuery Form Validation library
by bcardarella on Sunday November 04, 2012 @02:18PM
(#4740658)
I'm the author. I'd be interested to know which libraries you have combined with it and have had issues? Have you opened up any issues on Github about these libraries?
And what are the "non-standard validations"? If you are referring to custom validations that you wrote then you'll have to write the supporting javascript validation.
How do other developers solve this problem?
I've found a very practical solution on the .NET side of things is to use data annotations with MVC - which allows you to markup your model with metadata describing the shape of acceptable data and have it automagically validated on both client and server - but haven't found anything similar in PHP and other languages. Any recommendations?