{"id":21177445,"url":"https://github.com/betsol/angular-form-validation","last_synced_at":"2025-07-09T22:30:45.905Z","repository":{"id":16432559,"uuid":"19184002","full_name":"betsol/angular-form-validation","owner":"betsol","description":"AngularJS module to automate form validations","archived":false,"fork":false,"pushed_at":"2015-04-09T12:00:47.000Z","size":354,"stargazers_count":8,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T19:18:20.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/betsol.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-26T17:43:54.000Z","updated_at":"2021-01-11T03:05:48.000Z","dependencies_parsed_at":"2022-09-10T05:10:38.761Z","dependency_job_id":null,"html_url":"https://github.com/betsol/angular-form-validation","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/betsol/angular-form-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fangular-form-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fangular-form-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fangular-form-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fangular-form-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betsol","download_url":"https://codeload.github.com/betsol/angular-form-validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fangular-form-validation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264504573,"owners_count":23618825,"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":[],"created_at":"2024-11-20T17:16:08.923Z","updated_at":"2025-07-09T22:30:45.642Z","avatar_url":"https://github.com/betsol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-form-validation\n\n## Description\n\nThis advanced module for AngularJS provides you with facilities to automate form validation,\nerror display and input decorations. No more manual application of `ngClass` directives\nto all the form elements and creating error messages for every possible input.\nJust install this module and provide input requirements the standard way by using native *HTML5*\nattributes like `maxlength`, `required` and standard AngularJS directives like `ngMin`, `ngMax`\nand the like. No need to add directives to all the input fields.\n\nYou can configure this module to decorate forms as you see fit only once and all the forms of\nyour application will automatically benefit from it.\n\n### Features\n\n- Works out of the box with almost zero configuration\n- No need to specify any additional directives besides standard input constraints\n- Has built-in supports for **Bootstrap 3**, see the [Using Bootstrap 3](#using-bootstrap-3) section\n- Automatically decorates *valid*, *invalid* and *non-modified* input fields\n- Automatically adds error messages to invalid input fields\n- Supports translations (i18n) and provides some [built-in languages][built-in-languages]\n- Designed with flexibility in mind, almost every aspect of this module\n  can be configured and overridden (see [the API section][docs-api] of this document)\n- You can easily select DOM elements to decorate by providing custom traversing functions\n- You can change the way forms are decorated by overriding some aspects of existing decorators or\n  by providing your own implementation of them\n- You can change the way error list is rendered by modifying default error list renderer or\n  by providing your own implementation\n- *jQuery* is not required since version `1.0.3`\n  \n### Demo\n\nFeel free to play with the [Demo](http://plnkr.co/edit/dJs5Wye2WEy7T6gEEfIj?p=preview).\n\n## Installation\n\n### Dependencies\n\nThis library requires [`angular-input-modified`][github-input-modified] module.\nIt is used to detect modified input fields.\n\n### Install library with bower\n\n`bower install --save angular-form-validation`\n\n### Add library to your page\n\n``` html\n\u003cscript type=\"text/javascript\" src=\"angular-form-validation/dist/angular-form-validation.js\"\u003e\u003c/script\u003e\n```\n\nUse minified version: `angular-form-validation.min.js` in production\nand uncompressed version: `angular-form-validation.js` during development/testing.\n\nAlso, don't forget to add dependencies, see [Dependencies](#dependencies) section above.\n\n### Add dependency in your application's module definition\n\n``` javascript\nvar application = angular.module('application', [\n    // ...\n    'ngFormValidation'\n]);\n```\n\n## Usage\n\nThis module is working out of the box with default settings and no configuration.\nHowever, in order to unleash it's full potential, you should provide additional\nconfigurations through exposed providers. Please see [the API documentation][docs-api] in order\nto understand how to do this. It's written for real humans!\n\n### Important requirements\n\nIn order for this module to work, you must have semantically correct HTML form, i.e.\nall your `input` elements must be placed inside of a `form` element.\n\nAlso, all your `form` and `input` elements must have a `name` attributes with unique values.\n\n### Using Bootstrap 3\n\nThis module provides *Bootstrap 3* support out of the box.\n\nJust add the following code to your project:\n\n```JavaScript\nmodule\n\n    // ...\n    \n    .config([\n        'formValidationDecorationsProvider',\n        'formValidationErrorsProvider',\n        function(\n            formValidationDecorationsProvider,\n            formValidationErrorsProvider\n        ) {\n            formValidationDecorationsProvider\n                .useBuiltInDecorator('bootstrap')\n            ;\n            formValidationErrorsProvider\n                .useBuiltInErrorListRenderer('bootstrap')\n            ;\n        }\n    ])\n    \n    // ...\n    \n;\n```\n\nAnd if you want to use *fontawesome* icon library instead of *glyphicons* (default):\n\n```JavaScript\nformValidationDecorationsProvider\n    .useBuiltInDecorator('bootstrap')\n        .useIconLibrary('fontawesome')\n;\n```\n\n## API\n\nSee the detailed [API documentation][docs-api].\n\n## Forced validation\n\nSince version `1.0.1` of this module, input elements **are not** decorated in any way if they are pristine.\nTo counter this behavior functionality called \"forced validation\" was introduced.\n\n- Call `ngModel.forceValidation(true/false)` to enable/disable forced validation for this input element\n- Call `ngForm.forceValidation(true/false)` to set forced validation on all form elements\n\nWhen forced validation is enabled for an input element it **will be** decorated even if it's pristine.\n\n---\n\nIf you want to force validation on form as soon as controller is loaded, you should use the following trick:\n\n```javascript\n\n.controller('DefaultController', function($scope, $timeout) {\n  // ...\n  $timeout(function () {\n    $scope.form.forceValidation(true);\n  }, 0);\n})\n\n```\n\nUsing `$timeout` with zero interval makes sure, that our code is executed when\ncompilation is complete and `$scope.form` is available.\n\n## Feedback\n\nIf you have found a bug or have another issue with the library - please [create an issue][new-issue]\nin this GitHub repository.\n\nIf you have a question - file it with [StackOverflow][so-ask] and send me a\nlink to [s.fomin@betsol.ru][email]. I will be glad to help.\nAlso, please create a [plunk][plunker] to demonstrate the issue if appropriate.\nYou can even fork our [demo plunk][demo].\n\nHave any ideas or propositions? Feel free to contact me by [E-Mail][email].\n\nCheers!\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Slava Fomin II\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n[so-ask]: http://stackoverflow.com/questions/ask?tags=angularjs,javascript\n[email]: mailto:s.fomin@betsol.ru\n[plunker]: http://plnkr.co/\n[github-input-modified]: //github.com/betsol/angular-input-modified\n[docs-api]: docs/api.md\n[demo]: http://plnkr.co/edit/dJs5Wye2WEy7T6gEEfIj?p=preview\n[new-issue]: //github.com/betsol/angular-form-validation/issues/new\n[built-in-languages]: docs/api/errors-provider.md#supported-languages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fangular-form-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetsol%2Fangular-form-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fangular-form-validation/lists"}