{"id":22862426,"url":"https://github.com/tomi77/backbone-forms-validators","last_synced_at":"2025-03-31T08:46:14.880Z","repository":{"id":58233383,"uuid":"63311202","full_name":"tomi77/backbone-forms-validators","owner":"tomi77","description":"A set of Backbone-Forms validators","archived":false,"fork":false,"pushed_at":"2018-03-03T14:15:43.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T14:03:26.289Z","etag":null,"topics":["backbone-forms","email-validation","nip-validation","pesel-validation","phone-validation","regon-validation","validation","validators"],"latest_commit_sha":null,"homepage":"https://tomi77.github.io/backbone-forms-validators/index.html","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomi77.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-14T07:07:11.000Z","updated_at":"2017-06-22T06:44:23.000Z","dependencies_parsed_at":"2022-08-30T20:10:31.073Z","dependency_job_id":null,"html_url":"https://github.com/tomi77/backbone-forms-validators","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi77%2Fbackbone-forms-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi77%2Fbackbone-forms-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi77%2Fbackbone-forms-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi77%2Fbackbone-forms-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomi77","download_url":"https://codeload.github.com/tomi77/backbone-forms-validators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443525,"owners_count":20778247,"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":["backbone-forms","email-validation","nip-validation","pesel-validation","phone-validation","regon-validation","validation","validators"],"created_at":"2024-12-13T10:13:32.335Z","updated_at":"2025-03-31T08:46:14.858Z","avatar_url":"https://github.com/tomi77.png","language":"CoffeeScript","readme":"# Backbone-Forms validators\n\n[![Build Status](https://travis-ci.org/tomi77/backbone-forms-validators.svg?branch=master)](https://travis-ci.org/tomi77/backbone-forms-validators)\n[![Coverage Status](https://coveralls.io/repos/github/tomi77/backbone-forms-validators/badge.svg)](https://coveralls.io/github/tomi77/backbone-forms-validators)\n[![Code Climate](https://codeclimate.com/github/tomi77/backbone-forms-validators/badges/gpa.svg)](https://codeclimate.com/github/tomi77/backbone-forms-validators)\n[![devDependencies Status](https://david-dm.org/tomi77/backbone-forms-validators/dev-status.svg)](https://david-dm.org/tomi77/backbone-forms-validators?type=dev)\n[![peerDependency Status](https://david-dm.org/tomi77/backbone-forms-validators.png)](https://david-dm.org/tomi77/backbone-forms-validators?type=peer)\n![Downloads](https://img.shields.io/npm/dt/backbone-forms-validators.svg)\n\nA set of [Backbone-Forms](https://github.com/powmedia/backbone-forms) validators\n\n## Table of contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n  * [RequireJS](#requirejs)\n  * [Vanilla JS](#vanillajs)\n  * [Webpack](#webpack)\n* [Validators](validators)\n  * [multiple](#multiple)\n  * [phone](#phone)\n  * [maxlength](#maxlength)\n  * [minlength](#minlength)\n* [Validators PL](#validatorspl)\n  * [nip](#nip)\n  * [pesel](#pesel)\n  * [regon](#regon)\n\n## Installation\n\n~~~bash\nbower install backbone-forms-validators\n~~~\n\nor\n\n~~~bash\nnpm install backbone-forms-validators\n~~~\n\n## Usage\n\n### RequireJS\n\nAdd packages to config file:\n\n~~~js\npackages: [{\n  name: 'backbone-forms-validators',\n  location: 'bower_components/backbone-forms-validators',\n  main: 'bbf-validators'\n}]\n~~~\n\nUse:\n\n~~~js\ndefine['backbone-forms-validators', 'backbone-forms-validators/pl'], function() {\n  // Your code\n}\n~~~\n\n### Vanilla JS\n\n~~~html\n\u003cscript type=\"text/javascript\" src=\"bower_components/backbone-forms-validators/bbf-validators.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"bower_components/backbone-forms-validators/pl.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Rest od code --\u003e\n~~~\n\n### Webpack\n\n~~~js\nrequire('backbone-forms-validators')\nrequire('backbone-forms-validators/pl')\n\n// Rest of code\n~~~\n\n## Validators\n\n### multiple\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    emails: {\n      type: 'Text',\n      validators: [{\n        type: 'multiple',\n        base_type: 'email',\n        separator: ',',\n        message: 'Emails separated by colon'\n      }]\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/multiple.html)\n\n### phone\n\nValidates phone number\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    phone: {\n      type: 'Text',\n      validators: ['phone']\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/phone.html)\n\n### minlength\n\nValidates length of entered text\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    text: {\n      type: 'Text',\n      validators: [{\n        type: 'minlength',\n        minlength: 3\n      }]\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/minlength.html)\n\n### maxlength\n\nValidates length of entered text\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    text: {\n      type: 'Text',\n      validators: [{\n        type: 'maxlength',\n        maxlength: 9\n      }]\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/maxlength.html)\n\n## Validators PL\n\n### nip\n\nValidates NIP (Polish tax identification number)\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    nip: {\n      type: 'Text',\n      validators: ['nip']\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/nip.html)\n\n### pesel\n\nValidates Pesel (Polish identification number)\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    pesel: {\n      type: 'Text',\n      validators: ['pesel']\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/pesel.html)\n\n### regon\n\nValidates REGON (Polish Taxpayer Identification Number)\n\n~~~js\nvar form = new Backbone.Form({\n  schema: {\n    regon: {\n      type: 'Text',\n      validators: ['regon']\n    }\n  }\n});\n~~~\n\n[Demo](https://tomi77.github.io/backbone-forms-validators/regon.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomi77%2Fbackbone-forms-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomi77%2Fbackbone-forms-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomi77%2Fbackbone-forms-validators/lists"}