Really Easy Field Validation with Mootools
UPDATE: this file is deprecated. See the validator script in our common code in the wiki.
Back in May I posted, er, recycled a post from Ajaxian about really easy field validation using Prototype (and Scriptaculous). I really liked this concept of field validation and, as I move through my current project of rewriting all the javascript on Download.com (pity me), I ran into a few validation tasks that made me think back to this post.
So I rolled up my sleeves and dove in to the code from Dexagogo and refactored it to work with Mootools, which is what we’re using as the foundation framework for our javascript efforts here at CNET (and to which I contribute).
I’ll post more about this later, but really there’s not much to post. The Documentation page at Dexagogo pretty much says it all - it’s the same functionality and the same API. I can’t really take any credit for this; it’s all Dexagogo’s magic.
Update: I left a few console.log statements in this when I posted it which broke it for some of you. It’s fixed now.
Download the script | Demo

January 2nd, 2007 at 8:57 pm
Hey, cool stuff :)
January 2nd, 2007 at 10:19 pm
Cool. The demo isn’t working for me though (using Firefox 2.0.0.1, but I imagine you already tested with that so I’m not sure what’s up). BTW, most all of the validation regexes can be improved and/or shortened somewhat. I can try to work on this later if you’re interested.
January 2nd, 2007 at 10:47 pm
I left a console.log statement in there; you’ll need to remove that (I’ll do it myself tomorrow).
I didn’t write this library, just translated it. Valerio and I were already talking about writing something a little more flexible and a little less bulky. Feel free to change it however you like, or wait until we have something else to play with.
January 5th, 2007 at 8:22 am
[...] « Really Easy Field Validation with Mootools [...]
April 10th, 2007 at 5:11 am
I am still getting a few errors on your demo page and my own page testing out the toggle hyperlink and the radio buttons. This is using IE7 though…
Any thoughts?
April 10th, 2007 at 7:38 am
I updated this page; this version of the script is deprecated. See:
http://clientside.cnet.com/wiki/cnet-libraries/03-jswidgets#validator.js
September 3rd, 2007 at 11:35 am
I was just about to roll up my sleeves and do the same thing (convert Dexagogo’s stuff to Mootools) but you just saved me a ton of work good sir! Thank you!
February 28th, 2008 at 1:33 pm
Great stuff! You definitely saved me a lot of time with this! One question, if I have a day (Sunday) which I need to disable, how could I go about doing this?
Thanks so much!
February 28th, 2008 at 4:30 pm
Look in the docs (and look at the source) and see how you can write your own validators.
May 11th, 2008 at 8:14 am
hi, i would like to ask if this is already compatible for v1.2.b2?
well i just want to try to study it if to see if could create something which need for myself. I do hope you can give me thanks.
May 12th, 2008 at 8:36 am
Yes. You can download it from our download page at http://clientside.cnet.com/js or from our svn repository.