I wasn\'t sure if I could ask this kind of question, but after seeing this on Meta Stackoverflow, it looks like this kind of question is ok. Well, onto my question:
A fe
I like it a lot already, it keeps my html clean and the ability to build custom validators is great. One thing I added was a short hand for binding the validation and submit functions, and wrapped it up as a jQuery plugin:
if (jQuery) {
(function($)
{
$.regula = function(formId, callback)
{
regula.bind();
$("#" + formId).submit(function()
{
var validationResults = regula.validate();
if (validationResults.length > 0)
{
if (callback)
callback(validationResults);
return false;
}
return true;
});
};
})(jQuery);
}
Infact, I've just blogged about it to as I am that impressed with how clean and easy it is. I'm still going to spend time going through your source, to see how your accomplished it, but its a great start :)
In regards to integrating your framework, I work mostly with ASP.NET MVC, and it would be interesting to see how it translate server-side validation logic into client-side constraints. Something I might look over in the next month or so.