A simple jQuery validation plugin

29 Nov 2008

I needed to do some client-side validation for my most recently-launched client project, Fretbase (for guitar enthusiasts), so I did a quick search for a validation plugin for jQuery. I found a couple of good ones, but none did exactly what I needed in the way that I wanted, so I ended up writing my first jQuery plugin. And, with a little help from the fantastic jQuery resources out there, it turned out to be easy.

So, here it is, my oh-so-simple validation plugin, with the one key feature that I had to have — being able to validate multiple fields with the same name:

It’s not especially pretty, but it gets the job done. And it’s called like so: $(‘some_selector’).validate(); … which just so happens to be the same syntax of the other, much more elegant jQuery validation plugin, but which doesn’t validate multiple fields with the same name. :)


Actions

Informations

2 responses to “A simple jQuery validation plugin”

Douglas Karr (11:02:03) :

I recently used jQuery for the first time on our corporate site to slide in and out feed content and I was pretty impressed with how simple it was. I’ll definitely be giving it some more attention. Curious, some feedback I’ve heard is that new releases on jQuery have caused incompatibility issues with older versions. Have you heard the same?

Ben (06:37:04) :

I’ve only started using jQuery recently, so I’m not familiar with historical releases or its development history.

Leave a comment