14

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.

3 Answers 3

7

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.

3

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.

1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.