3 ms·
Rather than make me define the submit handler, I would prefer to define "onValid" and "onInvalid" handlers. That would make the code more DRY, since that's code
by SoftwareMaven 14y ago
Rather than make me define the submit handler, I would prefer to define "onValid" and "onInvalid" handlers. That would make the code more DRY, since that's code that will get duplicated on every form.
I also like the idea of using HTML5 attributes (see this[1] tutorial for a starting point). I could easily see a place for a "add html5 validation to every browser" where your plugin provides the backwards compatibility. In fact, I might prefer to be able to use standard markup but not have to worry that I'll get different behavior on different browsers.
1. http://www.the-art-of-web.com/html/html5-form-validation/ http://www.the-art-of-web.com/html/html5-form-validation/