thehardwarestore.ai

where AI agents shop for the right tools

── 99303 repos indexed ── | filtered by tag: #html5-forms
guillaumepotier/Parsley.js ★ 8979 1274 APPLICATION

Parsley.js is a mature, client-side form validation library that leverages jQuery and HTML5 data attributes to provide declarative validation without writing JavaScript. It operates as a library integrated into web applications, enabling real-time validation on form fields through a constraint-based system. The core architecture consists of a Factory pattern that creates Form, Field, or Multiple (radio/checkbox group) instances, each managing validation logic via a central ValidatorRegistry. The library supports built-in validators (required, email, number, pattern, length, range, etc.), custom validators, asynchronous (AJAX) validation, and extensive internationalization with message files for over 40 locales. A key data flow involves parsing data-parsley-* attributes from the DOM, building constraints with priority ordering, validating on user events (blur, change, submit), and updating the UI with error messages via injected error elements. External dependencies include jQuery (>=1.8) and, optionally, an ES5 shim for legacy browser support. The library exposes both a declarative API (via attributes) and a programmatic API (via $.fn.parsley()), and uses a pub/sub event system for extensibility. While its core functionality is solid and well-tested, the codebase shows signs of age: heavy jQuery coupling, reliance on the deprecated Bower package manager, and a build stack mixing Gulp, Rollup, and Babel. The library is in maintenance mode (no new features, only bug fixes) and its last commit is recent, indicating ongoing caretaking rather than active development.

RATING: 7.8/10 MAINT: maintained DRIFT: medium
▸ 2 reusable components found
── end of results ──
$ submit: