6 ms·
I'd prefer a library that reads its parameters from HTML5 attributes (such as required, maxlength, pattern, etc). That would bring support for client side form
by waxjar 14y ago
I'd prefer a library that reads its parameters from HTML5 attributes (such as required, maxlength, pattern, etc). That would bring support for client side form validation to browsers that don't natively support it. Ideally this would be as simple as loading a javascript file with <script> tags.
It would also be much easier to use, because there would be no API to "learn".
- th 14y agoThis is a great idea. It looks like there are at least two plugins already that claim to validate the new HTML5 attributes: [html5-form][1] and [h5Validate][2] [1]: http://www.matiasmancini.com.ar/jquery-plugin-ajax-form-validation-html5.html http://www.matiasmancini.com.ar/jquery-plugin-ajax-form-vali... [2]: http://ericleads.com/h5validate/ http://ericleads.com/h5validate/
- deleted 14y ago[deleted]
- BozeWolf 14y agoLike how angularjs works with directives? In angular you can create your own directives (HTML elements, so to say). You can add attributes to these directives. In this directive simply check if the browser supports the HTML5 element. if(this_is_true): render_this_element() else: mimic_behaviour().
- pags 14y agohttps://github.com/pags/fields.js https://github.com/pags/fields.js Give it a look. As you described, it simply parses standard input tag params, including HTML 5 types. It's my first attempt at anything like this, so be gentle.