{"id":13616262,"url":"https://github.com/nette/forms","last_synced_at":"2025-04-29T14:26:46.692Z","repository":{"id":12186542,"uuid":"14788795","full_name":"nette/forms","owner":"nette","description":"📝 Generating, validating and processing secure forms in PHP. Handy API, fully customizable, server \u0026 client side validation and mature design.","archived":false,"fork":false,"pushed_at":"2025-03-31T01:14:41.000Z","size":2561,"stargazers_count":503,"open_issues_count":33,"forks_count":149,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-04-10T00:05:34.620Z","etag":null,"topics":["forms","html","javascript","nette","nette-framework","php","safety","security","validation"],"latest_commit_sha":null,"homepage":"https://doc.nette.org/forms","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nette.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dg","custom":"https://nette.org/donate"}},"created_at":"2013-11-28T23:35:47.000Z","updated_at":"2025-03-31T01:14:46.000Z","dependencies_parsed_at":"2024-03-18T22:29:16.286Z","dependency_job_id":"16cc1f5a-ecea-46eb-99c7-892cb29c2e48","html_url":"https://github.com/nette/forms","commit_stats":{"total_commits":1347,"total_committers":97,"mean_commits":13.88659793814433,"dds":"0.14625092798812178","last_synced_commit":"1d8a434f21a567add9ea9e6f471fd00c579756a3"},"previous_names":["nette/bower-nette-forms"],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette%2Fforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette%2Fforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette%2Fforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette%2Fforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nette","download_url":"https://codeload.github.com/nette/forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251517467,"owners_count":21601984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forms","html","javascript","nette","nette-framework","php","safety","security","validation"],"created_at":"2024-08-01T20:01:25.998Z","updated_at":"2025-04-29T14:26:46.675Z","avatar_url":"https://github.com/nette.png","language":"PHP","funding_links":["https://github.com/sponsors/dg","https://nette.org/donate"],"categories":["PHP"],"sub_categories":[],"readme":"Nette Forms: greatly facilitates web forms\n==========================================\n\n[![Downloads this Month](https://img.shields.io/packagist/dm/nette/forms.svg)](https://packagist.org/packages/nette/forms)\n[![Tests](https://github.com/nette/forms/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/nette/forms/actions)\n[![Coverage Status](https://coveralls.io/repos/github/nette/forms/badge.svg?branch=master)](https://coveralls.io/github/nette/forms?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/nette/forms/v/stable)](https://github.com/nette/forms/releases)\n[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/forms/blob/master/license.md)\n\n\nIntroduction\n------------\n\nNette\\Forms greatly facilitates creating and processing web forms. What it can really do?\n\n- validate sent data both client-side (JavaScript) and server-side\n- provide high level of security\n- multiple render modes\n- translations, i18n\n\nWhy 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.\n\nNette 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.\n\nDocumentation can be found on the [website](https://doc.nette.org/forms).\n\n\n[Support Me](https://github.com/sponsors/dg)\n--------------------------------------------\n\nDo you like Nette Forms? Are you looking forward to the new features?\n\n[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg)\n\nThank you!\n\n\nInstallation\n------------\n\nThe recommended way to install is via Composer:\n\n```\ncomposer require nette/forms\n```\n\nIt requires PHP version 8.1 and supports PHP up to 8.4.\n\n\nClient-side support can be installed with npm or yarn:\n\n```\nnpm install nette-forms\n```\n\nUsage\n-----\n\nLet's create a simple registration form:\n\n```php\nuse Nette\\Forms\\Form;\n\n$form = new Form;\n\n$form-\u003eaddText('name', 'Name:');\n$form-\u003eaddPassword('password', 'Password:');\n$form-\u003eaddSubmit('send', 'Register');\n\necho $form; // renders the form\n```\nThough 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:\n\n```php\n$form-\u003eaddText('name', 'Name:')\n\t-\u003esetRequired('Please fill your name.');\n```\n\nTry 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.\n\n```html\n\u003cscript src=\"netteForms.js\"\u003e\u003c/script\u003e\n```\n\nNette Framework adds `required` class to all mandatory elements. Adding the following style will turn label of *name* input to red.\n\n```html\n\u003cstyle\u003e\n.required label { color: maroon }\n\u003c/style\u003e\n```\n\n[Continue…](https://doc.nette.org/en/forms).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnette%2Fforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnette%2Fforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnette%2Fforms/lists"}