Thanks Dmitry, that was what I was going for!
As I mentioned - Dojo has a pretty good implementation, in fact I
really like the way they have internationalized certain validations
under a country code. Their dojox.validate.us.zipcode is much nicer
than my Validator.isUKPostcode, but then you still have to take on
dojo to get it.
As I get time, I'll be addressing the following points:
* remove the dependency on underscore
* group internationalizations in the same way that dojox.validate does
* add some build scripts (i.e. rake tasks) to generate minified client-
side code and a suitably packaged nodejs module (in fact, wouldn't
that make a great library on its own!)
* add more validation routines ... numberFormat is favourite and
although credit card number validation is in may ways desirable, I
think that it's complicated to do well, and probably more useful in a
very client-side focused library so I might leave that for a while
* think about providing some events, so that anything could actually
call the validation (user input or some other async activity) and
observers would be notified ... something like:
myValidator.on('validated', function(isValid, errorList){}) and maybe
some sugar like myValidator.on('valid', fn) and
myValidator.on('invalid', fn)
I don't think any of this would add too much weight to the code and
would all make it a really nice drop in library. Once I've removed
underscore, I'll try and get it included in Fuchs' microjs list since
it really seems lacking an equivalent at the moment.
On Aug 15, 11:49 am, Dmitry Pashkevich <[email protected]> wrote:
> Neat toolkit! Looks quite flexible.
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]