explaingit

guillaumepotier/parsley.js

8,985JavaScriptAudience · vibe coderComplexity · 2/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((Parsley.js))
    What it does
      HTML form validation
      Attribute-based rules
    Features
      Required and format checks
      Real-time field validation
      Custom validator support
    Requirements
      jQuery 1.8 or higher
      No build step needed
    Use Cases
      Registration forms
      Contact forms
      Input range checks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add required-field, email format, and length validation to an HTML form without writing any custom JavaScript.

USE CASE 2

Show inline error messages next to a form field as the user moves between fields, before they even submit.

USE CASE 3

Validate a numeric input to ensure it falls within a specific range using only HTML attributes.

Tech stack

JavaScriptjQuery

Getting it running

Difficulty · easy Time to first run · 5min

Project is in maintenance mode, no new features are planned, only bug fixes are accepted.

Use freely for any purpose, including commercial projects, as long as you keep the copyright notice (MIT License).

In plain English

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.

Copy-paste prompts

Prompt 1
Using Parsley.js, set up a registration form that requires a name field, validates the email format, and enforces a minimum password length of 8 characters, show me the HTML attributes needed.
Prompt 2
Show me how to add a custom Parsley.js validator that checks whether a username is already taken by calling a backend API endpoint.
Prompt 3
Help me configure Parsley.js to validate fields as the user tabs between them rather than waiting until the form is submitted.
Prompt 4
Write the complete HTML for a contact form with Parsley.js validation: required name, valid email, and a message with at least 20 characters.
Prompt 5
Show me how to customize Parsley.js error messages in a different language and style the error elements with CSS.
Open on GitHub → Explain another repo

← guillaumepotier on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.