PHPackages                             jdz/form - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jdz/form

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

jdz/form
========

Framework-agnostic form building, filtering and validation library

1.0.3(1mo ago)019↓66.7%2MITPHPPHP &gt;=8.2

Since Feb 11Pushed 1mo agoCompare

[ Source](https://github.com/joffreydemetz/form)[ Packagist](https://packagist.org/packages/jdz/form)[ Docs](https://jdz.joffreydemetz.com/form)[ RSS](/packages/jdz-form/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (2)

JDZ Form
========

[](#jdz-form)

A framework-agnostic PHP library for building, filtering and validating forms.

Features
--------

[](#features)

- 🧱 **Rich field set**: text, email, url, tel, password, search, number, date/datetime/time/month/week/year, color, file, hidden, checkbox, radio, select, textarea
- 🧹 **Filters**: normalize input before validation (string, int, decimal, bool, array, email, url, tel, date, time, color, or a custom callback)
- ✅ **Rules**: declarative validation with typed error handling
- 🗂️ **Structure**: group fields into fieldsets and form rows (including boolean, checkboxes, input-group and hidden rows)
- 🔒 **CSRF &amp; captcha**: opt-in per form
- 🔗 **Fluent API**: chainable configuration, framework-agnostic rendering via `toData()`
- ✅ **Well tested**: 285 tests

Installation
------------

[](#installation)

```
composer require jdz/form
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher

Quick start
-----------

[](#quick-start)

```
use JDZ\Form\Form;
use JDZ\Form\FormData;

$form = new Form('contact');

$fieldset = $form->makeFormFieldset('main');
// add fields / rows to the fieldset, each with its filters and rules

// bind submitted values and run the lifecycle
$form->init(new FormData($_POST));

if ($form->submit()) {
    // $form->filter();  normalize
    // $form->validate(); apply rules
    if (!$form->getErrors()) {
        // persist $form->getData()
    }
}
```

Forms expose their state through `toData()`, so rendering is left entirely to the consuming application (Twig, plain PHP, an admin UI layer, etc.).

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

4

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e83e3701566e43438525ed14578487e732b849d152b5071aa1613a0dad96913?d=identicon)[jdz](/maintainers/jdz)

---

Top Contributors

[![joffreydemetz](https://avatars.githubusercontent.com/u/15113527?v=4)](https://github.com/joffreydemetz "joffreydemetz (26 commits)")

---

Tags

validationcoreformfilteringJDZ

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jdz-form/health.svg)

```
[![Health](https://phpackages.com/badges/jdz-form/health.svg)](https://phpackages.com/packages/jdz-form)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[siriusphp/validation

Data validation library. Validate arrays, array objects, domain models etc using a simple API. Easily add your own validators on top of the already dozens built-in validation rules

159784.6k15](/packages/siriusphp-validation)[arondeparon/laravel-request-sanitizer

An easy to use request sanitizer that allows you to sanitize your form data before validating it.

112164.1k5](/packages/arondeparon-laravel-request-sanitizer)[barbieswimcrew/zip-code-validator

Constraint class for international zipcode validation

772.5M](/packages/barbieswimcrew-zip-code-validator)[fp/jsformvalidator-bundle

JavaScript validation for Symfony forms.

127423.9k1](/packages/fp-jsformvalidator-bundle)[apy/jsfv-bundle

Symfony2 Javascript Form Validation Bundle with localisation support

92774.2k](/packages/apy-jsfv-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
