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.
JavaScript powered validation can be turned off in the user's browser, fail due to a scripting error, or be maliciously circumvented without much effort. Also, the whole process of form submission can be faked. Therefore, there is never a guarantee that what arrives server side, is clean and safe data.
HTML form validation can be done by JavaScript.
Notice that for validation, the JavaScript function containing the code to validate is called on the onSubmit event of the form.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With