PHPackages                             nette/forms - 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. nette/forms

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

nette/forms
===========

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

v3.3.0(6d ago)54413.6M↓58%146[23 issues](https://github.com/nette/forms/issues)[16 PRs](https://github.com/nette/forms/pulls)20BSD-3-ClausePHPPHP 8.3 - 8.5CI passing

Since May 11Pushed 4d ago47 watchersCompare

[ Source](https://github.com/nette/forms)[ Packagist](https://packagist.org/packages/nette/forms)[ Docs](https://nette.org)[ RSS](/packages/nette-forms/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (31)Versions (76)Used By (20)

Nette Forms: greatly facilitates web forms
==========================================

[](#nette-forms-greatly-facilitates-web-forms)

[![Downloads this Month](https://camo.githubusercontent.com/a07f995a34e0bd94bf8a1ab2b014cb34150cd7c1e440438fd925d42405820731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e657474652f666f726d732e737667)](https://packagist.org/packages/nette/forms)[![Tests](https://github.com/nette/forms/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/nette/forms/actions)[![Coverage Status](https://camo.githubusercontent.com/add9401edbb4811f2cf6e1f26ae167853540cb7fe0abe12c8b6f2e115b5ce0c4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e657474652f666f726d732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nette/forms?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/d069ddc3c9f283239aca064f39b23dee2744be995f602e4e4a67214c6bfd6198/68747470733a2f2f706f7365722e707567782e6f72672f6e657474652f666f726d732f762f737461626c65)](https://github.com/nette/forms/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/nette/forms/blob/master/license.md)

Introduction
------------

[](#introduction)

Nette\\Forms greatly facilitates creating and processing web forms. What it can really do?

- validate sent data both client-side (JavaScript) and server-side
- provide high level of security
- multiple render modes
- translations, i18n

Why should you bother setting up framework for a simple web form? You won't have to take care about routine tasks such as writing two validation scripts (client and server) and your code will be safe against security breaches.

Nette Framework puts a great effort to be safe and since forms are the most common user input, Nette forms are as good as impenetrable. All is maintained dynamically and transparently, nothing has to be set manually. Well known vulnerabilities such as Cross Site Scripting (XSS) and Cross-Site Request Forgery (CSRF) are filtered, as well as special control characters. All inputs are checked for UTF-8 validity. Every multiple-choice, select box and similar are checked for forged values upon validating. Sounds good? Let's try it out.

Documentation can be found on the [website](https://doc.nette.org/forms).

[Support Me](https://github.com/sponsors/dg)
--------------------------------------------

[](#support-me)

Do you like Nette Forms? Are you looking forward to the new features?

[![Buy me a coffee](https://camo.githubusercontent.com/afa7c20ccaac10ac4f1f51669bafb212856b932e0c8b276cb290336cf08624b8/68747470733a2f2f66696c65732e6e657474652e6f72672f69636f6e732f646f6e6174696f6e2d332e737667)](https://github.com/sponsors/dg)

Thank you!

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

[](#installation)

The recommended way to install is via Composer:

```
composer require nette/forms

```

It requires PHP version 8.3 and supports PHP up to 8.5.

Client-side support can be installed with npm or yarn:

```
npm install nette-forms

```

Usage
-----

[](#usage)

Let's create a simple registration form:

```
use Nette\Forms\Form;

$form = new Form;

$form->addText('name', 'Name:');
$form->addPassword('password', 'Password:');
$form->addSubmit('send', 'Register');

echo $form; // renders the form
```

Though we mentioned validation, yet our form has none. Let's fix it. We require users to tell us their name, so we should call a `setRequired()` method, which optional argument is an error message to show, if user does not fill his name in:

```
$form->addText('name', 'Name:')
	->setRequired('Please fill your name.');
```

Try submitting a form without the name - you will keep seeing this message until you meet the validation rules. All that is left for us is setting up JavaScript rules. Luckily it's a piece of cake. We only have to link `netteForms.js`, which is located at `/client-side/forms` in the distribution package.

```

```

Nette Framework adds `required` class to all mandatory elements. Adding the following style will turn label of *name* input to red.

```

.required label { color: maroon }

```

[Continue…](https://doc.nette.org/en/forms).

###  Health Score

82

—

ExcellentBetter than 100% of packages

Maintenance98

Actively maintained with recent releases

Popularity69

Solid adoption and visibility

Community56

Growing community involvement

Maturity96

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 90.8% 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 ~59 days

Recently: every ~8 days

Total

75

Last Release

4d ago

Major Versions

v2.4.9 → v3.0.02019-02-28

v2.4.10 → v3.0.22019-11-19

v2.4.11 → v3.1.02021-01-19

v2.4.x-dev → v3.1.12021-02-04

PHP version history (12 changes)v2.2.0PHP &gt;=5.3.1

v2.4.0PHP &gt;=5.6.0

v3.0.0PHP &gt;=7.1

v2.4.11PHP &gt;=5.6 &lt;8.1

v3.1.0PHP &gt;=7.2 &lt;8.1

v3.1.4PHP &gt;=7.2 &lt;8.2

v3.1.8PHP &gt;=7.2 &lt;8.3

v3.1.12PHP 7.2 - 8.3

v3.2.0PHP 8.1 - 8.3

v3.2.4PHP 8.1 - 8.4

v3.2.8PHP 8.1 - 8.5

v3.3.0-RCPHP 8.3 - 8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f266513a3ca97500ec3d85d562b9279c7a6346358fe2b8d90390ece717a027?d=identicon)[david@grudl.com](/maintainers/david@grudl.com)

---

Top Contributors

[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (1228 commits)")[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (10 commits)")[![fprochazka](https://avatars.githubusercontent.com/u/158625?v=4)](https://github.com/fprochazka "fprochazka (8 commits)")[![vrana](https://avatars.githubusercontent.com/u/117453?v=4)](https://github.com/vrana "vrana (8 commits)")[![hrach](https://avatars.githubusercontent.com/u/284263?v=4)](https://github.com/hrach "hrach (7 commits)")[![matej21](https://avatars.githubusercontent.com/u/1276059?v=4)](https://github.com/matej21 "matej21 (7 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (6 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (6 commits)")[![MartyIX](https://avatars.githubusercontent.com/u/203266?v=4)](https://github.com/MartyIX "MartyIX (5 commits)")[![milo](https://avatars.githubusercontent.com/u/439140?v=4)](https://github.com/milo "milo (5 commits)")[![norbe](https://avatars.githubusercontent.com/u/194486?v=4)](https://github.com/norbe "norbe (5 commits)")[![Vrtak-CZ](https://avatars.githubusercontent.com/u/112567?v=4)](https://github.com/Vrtak-CZ "Vrtak-CZ (5 commits)")[![fabik](https://avatars.githubusercontent.com/u/816866?v=4)](https://github.com/fabik "fabik (4 commits)")[![hranicka](https://avatars.githubusercontent.com/u/3034538?v=4)](https://github.com/hranicka "hranicka (4 commits)")[![dakorpar](https://avatars.githubusercontent.com/u/9303856?v=4)](https://github.com/dakorpar "dakorpar (4 commits)")[![Ciki](https://avatars.githubusercontent.com/u/342730?v=4)](https://github.com/Ciki "Ciki (4 commits)")[![jtojnar](https://avatars.githubusercontent.com/u/705123?v=4)](https://github.com/jtojnar "jtojnar (3 commits)")[![h4kuna](https://avatars.githubusercontent.com/u/335722?v=4)](https://github.com/h4kuna "h4kuna (3 commits)")[![MilanPala](https://avatars.githubusercontent.com/u/1717814?v=4)](https://github.com/MilanPala "MilanPala (3 commits)")[![spaze](https://avatars.githubusercontent.com/u/1966648?v=4)](https://github.com/spaze "spaze (3 commits)")

---

Tags

formshtmljavascriptnettenette-frameworkphpsafetysecurityvalidationvalidationjavascriptnettebootstrapcsrfForms

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nette-forms/health.svg)

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

###  Alternatives

[nette/application

🏆 Nette Application: a full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write less, have cleaner code and your work will bring you joy.

45715.9M1.1k](/packages/nette-application)[uestla/recaptcha-control

reCAPTCHA control for Nette Framework forms

26579.8k1](/packages/uestla-recaptcha-control)[pear/html_quickform2

Provides methods to create, validate and render HTML forms in PHP.

24529.5k2](/packages/pear-html-quickform2)[apy/jsfv-bundle

Symfony2 Javascript Form Validation Bundle with localisation support

92773.7k](/packages/apy-jsfv-bundle)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5681.6k2](/packages/sheadawson-silverstripe-zenvalidator)[hybridlogic/validation

A simple, extensible validation library for PHP with support for filtering and validating any input array along with generating client side validation code.

641.1k](/packages/hybridlogic-validation)

PHPackages © 2026

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