{"id":33960007,"url":"https://github.com/global-source/javascript_form_validator","last_synced_at":"2025-12-12T21:37:39.219Z","repository":{"id":57048859,"uuid":"77355709","full_name":"global-source/javascript_form_validator","owner":"global-source","description":"Native Javascript (Include ES6) Library to enable HTML-5(type) validation on various browsers.","archived":false,"fork":false,"pushed_at":"2019-10-10T07:20:28.000Z","size":191,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-11T02:20:41.862Z","etag":null,"topics":["dom","dynamic","es6-javascript","html5-validation","javascript","javascript-validation","lightweight","listen","native-javascript-plugin","validation-library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/global-source.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-12-26T03:36:41.000Z","updated_at":"2021-03-26T08:32:51.000Z","dependencies_parsed_at":"2022-08-23T17:50:33.407Z","dependency_job_id":null,"html_url":"https://github.com/global-source/javascript_form_validator","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/global-source/javascript_form_validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/global-source%2Fjavascript_form_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/global-source%2Fjavascript_form_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/global-source%2Fjavascript_form_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/global-source%2Fjavascript_form_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/global-source","download_url":"https://codeload.github.com/global-source/javascript_form_validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/global-source%2Fjavascript_form_validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27692337,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dom","dynamic","es6-javascript","html5-validation","javascript","javascript-validation","lightweight","listen","native-javascript-plugin","validation-library"],"created_at":"2025-12-12T21:37:38.555Z","updated_at":"2025-12-12T21:37:39.213Z","avatar_url":"https://github.com/global-source.png","language":"JavaScript","readme":"## Global Source - JavaScript Form Validator [Ready to Use] \n\n\n[![Packagist](https://img.shields.io/badge/JavaScript-Core-brightgreen.svg)](https://github.com/global-source/javascript_form_validator) [![Packagist](https://img.shields.io/badge/JavaScript-ES6-green.svg)](https://github.com/global-source/javascript_form_validator)  [![License](https://img.shields.io/badge/Build-V.2.0-blue.svg)](https://github.com/shankarThiyagaraajan/PHP_Migration/blob/master/LICENSE)\n\n\n### Installation \n\n    git clone https://github.com/global-source/javascript_form_validator.git\n    git checkout -b [VERSION]\n\n    \n## Why me ?\n\n  * Support **Native** and **ES6** Javascript,\n  * Pure Javascript Code (**No Dependency**),\n  * Simplified Implementations,\n  * **HTML 5 validation** for all Browsers,\n  * Reliable and **Dynamic** level **DOM** Validations,\n  * Dynamic auto scroll with element.\n\n\n**Steps to Integrate to Form :**\n\n```html        \n \u003cscript src=\"formValidator.js\"\u003e\u003c/script\u003e\n or\n \u003cscript src=\"formValidator.es6.js\"\u003e\u003c/script\u003e\n```\n\nThen Integrate your form with Validator.\n\n```javascript\n    \n    var myform = new jsValidator().init({\n        form: 'form2submit',   // #id\n    });\n    \n```\n             \n\n## Options\n\n| Name        | Values          | Descriptions                                                                  | Mandatory |\n| ----------- | --------------- | ----------------------------------------------------------------------------- | --------- |\n| form        | #ID             | **ID** of the Form to  handle validations and filters.                        |    Yes    |\n| forceFilter | Bool            | **True**, to allow form filter without form validations. **False**, default.  |    No     |\n| message     | Object          | Response message for all HTML elements.                                       |    No     |\n| Log         | Bool            | To enable error log on console.                                               |    No     |\n\n---\n\n## Actions\n\n### `check()` : Return as Form is Valid or Not.\n\n```javascript\n// Retrun status as True|False.\n myform.check() \n```\n\n### `update()` : Update Newly created DOM elements to Validator.\n\n```javascript\n // It will update the DOM.\n myform.update() \n```\n---\n\n## Attributes\n\n| Name              | Values          | Descriptions                                                                 |\n| ----------------- | --------------- | ---------------------------------------------------------------------------- |\n| required          |  True, False    | Set the fields is required to submit the Form.                               |\n| min               |  Integer        | To set the Minimun value to proceed.                          |\n| max               |  Integer        | To set the Maximum value to proceed.                          |\n| data-maxlength=\"10\" |  Integer        | To set the Maximum length of characters to proceed.                          |\n| maxLength=\"10\"     |  Integer        | To set the Maximum length of characters to proceed.                          |\n| type=\"password\"    |  AlphaNumeric   | To set and compare password.                                                 |\n| type=\"email\"       |  AlphaNumeric   | To check the email is valid or not.                                          |\n| type=\"file\"       |  string ['png,jpeg..']   | To check the file format is allowed or not.                                          |\n| data-message=\"Error Message\"| String | User defined, element based direct error message to handle.                 |\n| data-allow=\"onlyAlpha\"| Alphabets Only | Allow only string, no digits and no special characters.                      |\n| data-allow=\"string\"|  Alphabets + Numbers Only | Allow only string and digits, no special characters.                         |\n| data-allowSpecial=\"/_+\"| Special characters | Allow only given special characters.                                 |\n| [INDEX]           |  Numeric        | Now supports Min\u0026Max validation to show the limit.                           |\n          \nCurrently the validation will trigger on submit button trigger.\n\nIt has automated listener to monitor every changes on form.\n\n**Note:**\n\n1. Validation take place between tags, so need to specify the **ID**  \n   of the Form or any other tags.\n   \n```html\n   \u003cform id=\"form2submit\"\u003e \u003c/form\u003e  // Preferred\n           \n   \u003cdiv id=form2submit\u003e \u003c/div\u003e      // Not-Preferred.\n```\n           \n \n#### For General Input Validation\n           \n2. Input Fields should specify the type of validation.\n    \n```html\n   \u003cform method=\"post\" id=\"form2submit\" novalidate\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eOnly Alpha\u003c/label\u003e\n        \u003cinput type=\"text\" data-allow=\"onlyAlpha\" name=\"alpha\"\n               data-message=\"\u003cb style='color:green'\u003eThis field is required.\u003c/b\u003e\" required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eString\u003c/label\u003e\n        \u003cinput type=\"text\" data-allow=\"string\" data-message=\"This also required.\" data-allowSpecial=\"+-\" name=\"string\"\n               required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003ePattern\u003c/label\u003e\n        \u003cinput type=\"text\" pattern=\"^[0-5]+$\" data-allowSpecial=\"/-\" name=\"pattern\"\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eNumber\u003c/label\u003e\n        \u003cinput type=\"number\" name=\"number\" required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eMin Validator\u003c/label\u003e\n        \u003cinput type=\"text\" name=\"myNumber\" min=\"5\" max=\"10\" required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eEmail Validator\u003c/label\u003e\n        \u003cinput type=\"email\" name=\"email\" required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n         \u003clabel for=\"file\"\u003eFile\u003c/label\u003e\n         \u003cinput type=\"file\" required class=\"form-control\" id=\"file\" data-extensions=\"png,jpeg,jpg\" name=\"file\"\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003ePassword\u003c/label\u003e\n        \u003cinput type=\"password\" name=\"password\" data-check=\"repassword\" id=\"password\" required\u003e\n    \u003c/div\u003e\n     \u003cdiv\u003e\n        \u003clabel\u003ePassword\u003c/label\u003e\n        \u003cinput type=\"password\" name=\"password\" data-check=\"repassword\" id=\"password\" required\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003clabel\u003eList\u003c/label\u003e\n         \u003cselect name=\"list\" required\u003e\n             \u003coption value=\"item1\"\u003eItem1\u003c/option\u003e\n             \u003coption value=\"item2\"\u003eItem2\u003c/option\u003e\n             \u003coption value=\"item3\"\u003eItem3\u003c/option\u003e\n         \u003c/select\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n         \u003clabel\u003eDescription\u003c/label\u003e\n         \u003ctextarea required name=\"desc\"\u003e\u003c/textarea\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n        \u003cinput type=\"submit\" value=\"Submit\"\u003e\n    \u003c/div\u003e\n\u003c/form\u003e\n```\n\n3. In form use **`novalidate`** to avoid browser interuptions.\n    \n    ```html\n         \u003cform method=\"POST/GET/PUT/PATCH/DELETE\" action=\"PATH-TO-HANDLE\" id=\"form2submit\" novalidate\u003e \n         ...\n         ...\n         \u003c/form\u003e\n    ```\n         \n#### Sample\n\n```javascript\n\n // For Native \u0026 ES6 Javascript.\n var myform = new jsValidator().init({\n        form: 'form2submit',   // #id\n        forceFilter: true,\n         message: {\n            required: 'This field is required !',\n            min: '\u003cbr\u003e\u003cspan style=\"color: red;\"\u003eThis field is less then the limit\u003c/span\u003e',\n            max: 'This field is exceeds the limit',\n            password: 'Password doesn\\'t match !',\n            email: 'Invalid Email found !',\n            file: 'Invalid File format given'\n        }\n    });\n    \n```\n           \nIt Will listen the **Submit** event **Automatically** and initiating the validation checks.\nAnd based on response, it will allow to submit or throw messages.\n\n\nLicense\n===\n\nCopyright (c) 2016 Shankar Thiyagaraajan\n\n### MIT License\n\n           \n   \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobal-source%2Fjavascript_form_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobal-source%2Fjavascript_form_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobal-source%2Fjavascript_form_validator/lists"}