dominar icon indicating copy to clipboard operation
dominar copied to clipboard

Add support for adding basic validation by attributes

Open garygreen opened this issue 8 years ago • 2 comments

Might be a good idea?

<input type="text" name="username" data-dominar="required|alpha">

garygreen avatar Aug 27 '15 16:08 garygreen

I'm sure there are folks who would like it.... not me! I really liked REMOVING all the markup when I moved from brand x to Dominar.

stocksp avatar Aug 27 '15 16:08 stocksp

I somewhat agree, as I don't like libraries like parsley.js or others that promote putting a lot of validation logic in the elements themselves, but because dominar is so terse in specifying rules it can sometimes be quicker to specify them in-line and still look clean. A lot of people like doing it as well, so I wouldn't want to put those guys off using dominar.

With that said, it's pretty easy to support this yourself with some custom code (or I may make it optional inclusion at some point, dominar-inline.js or something).

garygreen avatar Sep 04 '15 16:09 garygreen