{"id":13750277,"url":"https://github.com/niceue/nice-validator","last_synced_at":"2025-12-12T04:02:33.295Z","repository":{"id":8056102,"uuid":"9467592","full_name":"niceue/nice-validator","owner":"niceue","description":"Simple, smart and pleasant validation solution.","archived":false,"fork":false,"pushed_at":"2023-09-13T09:26:16.000Z","size":2599,"stargazers_count":609,"open_issues_count":20,"forks_count":146,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-05-16T10:05:53.108Z","etag":null,"topics":["form-validation","javascript","jquery-plugin","nice","validate","validation","validator"],"latest_commit_sha":null,"homepage":"http://niceue.github.io/nice-validator/","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/niceue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-04-16T08:08:31.000Z","updated_at":"2025-03-22T09:10:16.000Z","dependencies_parsed_at":"2022-09-11T11:00:49.865Z","dependency_job_id":"dfedcef6-58b4-4cba-92be-3b2420a0b41f","html_url":"https://github.com/niceue/nice-validator","commit_stats":{"total_commits":863,"total_committers":10,"mean_commits":86.3,"dds":0.563151796060255,"last_synced_commit":"35e53bb8bc70f5fa1492648a830730487fc12428"},"previous_names":["niceue/validator"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niceue%2Fnice-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niceue%2Fnice-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niceue%2Fnice-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niceue%2Fnice-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niceue","download_url":"https://codeload.github.com/niceue/nice-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082891,"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":["form-validation","javascript","jquery-plugin","nice","validate","validation","validator"],"created_at":"2024-08-03T08:00:26.459Z","updated_at":"2025-12-12T04:02:27.955Z","avatar_url":"https://github.com/niceue.png","language":"JavaScript","readme":"# nice-validator\n[![Build Status](https://travis-ci.org/niceue/nice-validator.svg)](https://travis-ci.org/niceue/nice-validator)\n[![Downloads](https://img.shields.io/github/downloads/niceue/nice-validator/total.svg)](https://github.com/niceue/nice-validator/releases)\n[![Version](https://img.shields.io/npm/v/nice-validator.svg)](https://www.npmjs.com/package/nice-validator)\n[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](http://niceue.com/licenses/MIT-LICENSE.txt)\n\nSimple, smart and pleasant validation solution.\n\n[Download](https://github.com/niceue/nice-validator/releases) the latest release\nor install package via [npm](https://www.npmjs.com/) or [bower](http://bower.io/)\n```bash\n$ npm install nice-validator\n```\n```bash\n$ bower install nice-validator\n```\n\n## Getting started\n#### 1. Include [jQuery 1.7+](http://jquery.com)\n#### 2. Include nice-validator\nwidth `\u003cscript\u003e` tag:\n```html\n\u003cscript src=\"path/to/nice-validator/jquery.validator.min.js?local=en\"\u003e\u003c/script\u003e\n```\nvia [webpack](http://webpack.github.io/)\n```javascript\nrequire('nice-validator')\nrequire('nice-validator/local/zh-CN')\n```\n\nvia module loader [Requirejs](http://requirejs.org/):\n```javascript\nrequirejs.config({\n    paths: {\n        jquery: 'http://cdn.jsdelivr.net/jquery/1.12.3/jquery.min',\n        validator: 'path/to/nice-validator/local/en'\n    },\n    shim: {\n        validator: ['path/to/nice-validator/jquery.validator.js?css']\n    }\n});\n\nrequire(['validator']);\n```\n\n#### 3. Config rules\n```html\n\u003cform id=\"form1\"\u003e\n\u003cinput type=\"text\" name=\"field1\" data-rule=\"required;email;remote(checkEmail.php)\"\u003e\n\u003cinput type=\"text\" name=\"field2\" data-rule=\"required;length(6~16)\"\u003e\n\u003cinput type=\"text\" name=\"field3\" data-rule=\"match(field2)\"\u003e\n\u003cinput type=\"text\" name=\"field4\" data-rule=\"range(0~100)\" id=\"field4\"\u003e\n\u003cinput type=\"text\" name=\"field5\" data-rule=\"required(#field4:filled)\"\u003e\n\u003cinput type=\"text\" name=\"field6\" data-rule=\"required; mobile|email;\" data-msg=\"Please fill mobile or email\"\u003e\n\u003cinput type=\"text\" name=\"field7\"\n    data-rule=\"required; !digits; length(6~)\"\n    data-msg-digits=\"Please not fill pure digits\"\n    data-msg-length=\"Please fill at least {1} characters.\"\u003e\n\u003cinput type=\"checkbox\" name=\"field8\" data-rule=\"checked\"\u003e\n... yadda yadda ...\n\u003c/form\u003e\n```\nIt has started to work when you use native submitting.\n#### 4. Handle submit (Optional)\n```javascript\n$(\"#form1\").on('valid.form', function(){\n    // You can do something, then submit form by native\n    // this.submit();\n    // or submit form by ajax\n    $.post(\"path/to/server\", $(this).serialize())\n        .done(function(d){\n            // do something\n        });\n});\n```\n\n## Documention\n- [English](https://github.com/niceue/nice-validator/wiki/Getting-Started)\n- [简体中文](http://validator.niceue.com/)\n\n## Browser Support\n  * IE6+\n  * Chrome\n  * Safari 4+\n  * Firefox 9+\n  * Opera\n\n\n## Bugs / Contributions\n- [Report a bug](https://github.com/niceue/nice-validator/issues)\n- To contribute or send an idea, github message me or fork the project\n\n## Build\nInstall dependencies:\n```bash\n$ npm install -g gulp\n$ npm install\n```\nRun test and build:\n```bash\n$ gulp\n```\n\n\n## License\nnice-validator is available under the terms of the [MIT License](http://niceue.com/licenses/MIT-LICENSE.txt).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniceue%2Fnice-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniceue%2Fnice-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniceue%2Fnice-validator/lists"}