tags:

views:

1114

answers:

3

Any recommendations for a javascript form validation library. I could try and roll my own (but I'm not very good at javascript). Needs to support checking for required fields, and preferably regexp validation of fields.

+1  A: 

I've used this library for a couple of personal projects. It's pretty good, though I have had to make my own modifications to it a couple of times - nothing major, though, and it's easy enough to do so.

I'm sure you already do this, but also validate all of your information on the server-side, as well. Client-side-only validation is rarely, if ever, a good idea.

Tom
+3  A: 

I am about to start implementing javascript validation in my forms using jQuery Validation. I think that StackOverflow users this jQuery plugin as well. It seems to be a very mature validation library, however it does build on top of jQuery, so it might not fit for you.

Like Tom said, don't forget that server side validation.

AidenMontgomery
A: 

Personally I just rolled my own because it was much simpler to integrate with my error handling system and how I wanted it displayed on the site. 99% of the time you only care about a couple of things, required fields and comparing fields.

Nick Berardi