
jQuery Validation
A JavaScript library that adds form validation to existing HTML forms with jQuery.
- Stars
- 10.3k
- Forks
- 2.7k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 10 days ago
- Type
- Library
What it is
The jQuery Validation Plugin checks whether form fields are filled in and formatted correctly before a form is submitted, and shows error messages next to the fields. It is added to forms that already exist on a page, so you call a single method on the form to turn validation on. You can customize rules and messages for your application.
- Add required-field and format checks to a sign-up or contact form by calling validate() on the form
- Show error messages in a span element and link them to inputs using aria-describedby
- Trim whitespace before validation using the normalizer option
- Load the plugin with RequireJS in a modular page
Great for
- Developers maintaining websites that already use jQuery
- Teams that want drop-in validation for existing forms without rebuilding them
- Developers who need custom validation rules added to forms
- Projects that want error messages placed in a chosen element for better screen reader support
Not ideal for
- Projects that do not use jQuery, since the plugin depends on it
- Non-developers looking for a finished tool with no coding (it is a code library)
- Teams needing email validation stricter than the HTML5 specification pattern, which the README says the plugin follows; they should use a custom method instead
How to get it
- 1
Download the app
You'll need: jQuery
Clone the repository
git clone https://github.com/jquery-validation/jquery-validation.git - 2
Run it
- Download prebuilt files from https://jqueryvalidation.org/ or clone the repository
- Include jQuery and jquery.validate.js in your page with script tags
- Call $("form").validate() on the form you want to validate
- Open the page in a browser and test the form
- 3
Get the most out of it
- Use the errorElement option (for example "span") to make error messages easier for screen readers to announce
- Use the normalizer option to trim input values before validation if you need the old whitespace behavior
- Use jQuery.validator.addMethod to write custom validation rules for your own requirements
- Read the official documentation at jqueryvalidation.org for rule and message configuration
Downloads
Strengths
- Simple to start: include jQuery and the plugin, then call validate() on a form
- Supports customization of rules, messages and validation methods
- Includes accessibility support through the errorElement option, which adds ARIA attributes
Trade-offs
- Depends on jQuery, so it is not useful for projects built without it
- Behavior changed across versions (for example, whitespace trimming stopped in 1.14.0), so upgrades may need code changes
- The README is truncated and points to the external documentation for full rule and customization details
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| jquery-validation (this) | 10.3k | Library | beginner | 10 days ago | Developers maintaining websites that already use jQuery |
| select2 | 25.9k | Library | beginner | 8 days ago | Web developers who already use jQuery and want a better dropdown |
| tui.editor | 18k | Library | intermediate | 2.3 years ago | Web developers who want an embeddable Markdown editor in their own site or app |
| editor.md | 14.3k | Library | beginner | 2.5 years ago | Web developers who want a Markdown input box inside their own site or admin panel |
| jquery | 59.8k | Library | beginner | 5 days ago | Developers maintaining existing websites or plugins that already depend on jQuery |
| cheerio | 30.5k | Library | beginner | 4 days ago | JavaScript developers who already know jQuery-style selectors |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.