gitmyhub

Parsley.js

JavaScript ★ 9.0k updated 26d ago

Validate your forms, frontend, without writing a single line of javascript

Parsley.js validates HTML forms by reading rules you add as attributes directly in the HTML, so you can require fields, check email formats, or enforce length limits without writing any JavaScript.

JavaScriptjQuerysetup: easycomplexity 2/5

Parsley.js is a library for validating web forms without writing JavaScript code. Instead of scripting custom checks yourself, you add special attributes directly to your HTML form fields, such as marking a field as required or specifying that an email must be a valid format. Parsley reads those attributes and enforces the rules automatically when the user submits the form or moves between fields.

The library handles common validation needs like required fields, minimum and maximum lengths, numeric ranges, email formats, and pattern matching. Because the rules live in the HTML markup rather than separate script files, it is straightforward to add or change validation for a form without touching JavaScript at all.

Parsley depends on jQuery, the widely-used JavaScript utility library, and requires version 1.8 or higher. Beyond that dependency, no build step or framework is needed to get started.

The project is in maintenance mode. No new features are planned, and the current maintainer accepts bug fix contributions but asks that anyone wanting to work on new features check in before starting. The current stable version is 2.9.2. The library is released under the MIT license, which allows use in commercial and open source projects alike. Community questions are directed to Stack Overflow rather than the issue tracker.

Where it fits