3 ms·
Could it be that your form validation example is merely a symptom of not working at a high enough level of abstraction? In the rails world, for example, if you
by daveungerer 17y ago
Could it be that your form validation example is merely a symptom of not working at a high enough level of abstraction?
In the rails world, for example, if you've done your validates_* declarations on an ActiveRecord model, it shouldn't be too difficult to generate the javascript required for client-side validation.
Actually found a project that goes a long way towards achieving just that:
http://github.com/grimen/validatious-on-rails http://github.com/grimen/validatious-on-rails
But I guess you're referring to complex validations, expressed as code instead of validates_* declarations. It seems like you would prefer either an all-JS approach or an automated translation to JS, as per the blog post you linked. To me, it boils down to whether such a complicated validation is really appropriate for client-side validation and whether it blurs the lines between form validation and business logic to such an extent that it's better off just living on the server.
But I'd love to hear your further thoughts on the matter.