{"id":15101680,"url":"https://github.com/emretulek/jbvalidator","last_synced_at":"2025-09-26T22:31:47.398Z","repository":{"id":45203491,"uuid":"308986262","full_name":"emretulek/jbvalidator","owner":"emretulek","description":"HTML 5 \u0026 Bootstrap Jquery Form Validation Plugin","archived":true,"fork":false,"pushed_at":"2022-03-01T18:02:39.000Z","size":523,"stargazers_count":56,"open_issues_count":1,"forks_count":19,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-15T19:51:07.188Z","etag":null,"topics":["bootstrap5","form-validator","formvalidation","html-validation","html5","jquery"],"latest_commit_sha":null,"homepage":"https://emretulek.github.io/jbvalidator/index.html","language":"HTML","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/emretulek.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":"2020-10-31T22:56:42.000Z","updated_at":"2024-12-15T12:38:42.000Z","dependencies_parsed_at":"2022-08-30T08:30:29.901Z","dependency_job_id":null,"html_url":"https://github.com/emretulek/jbvalidator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emretulek%2Fjbvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emretulek%2Fjbvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emretulek%2Fjbvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emretulek%2Fjbvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emretulek","download_url":"https://codeload.github.com/emretulek/jbvalidator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234356526,"owners_count":18819381,"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":["bootstrap5","form-validator","formvalidation","html-validation","html5","jquery"],"created_at":"2024-09-25T18:28:06.577Z","updated_at":"2025-09-26T22:31:46.966Z","avatar_url":"https://github.com/emretulek.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"HTML 5 \u0026 Bootstrap Jquery Form Validation Plugin\n================================================\n\n### HTML 5 \u0026 Bootstrap 5 \u0026 Jquery 3\n\njbvalidator is a fresh new jQuery based form validation plugin that is created for the latest Bootstrap 5 framework and supports both client side and server-side validation.\n\n- Multiple languages.\n- Custom error messages.\n- Custom validation rules.\n- Easy to use via HTML data attribute.\n\n### Installation\n\n```\nnpm i @emretulek/jbvalidator\n```\nOr grab from jsdelivr CDN :\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@emretulek/jbvalidator\"\u003e\u003c/script\u003e\n```\n\n##### [DEMO LINK](https://emretulek.github.io/jbvalidator/)\n\n-   **Html 5 validation**\n-   **data-v-equal**: id of the element that should be the same\n-   **data-v-min-select**: multiple selectbox, minimum selectable count\n-   **data-v-max-select**: multiple selectbox, maximum selectable count\n-   **data-checkbox-group**: the parent attribute of group checkbox elements\n-   **data-v-min**: alternative of the min attribute, this can be used for attribute type text\n-   **data-v-max**: alternative of the max attribute, this can be used for attribute type text\n-   **data-v-min-length**: alternative of the minlength attribute\n-   **data-v-max-length**: alternative of the maxlength attribute\n-   **data-v-min-size**: the input type file minimum file size (byte)\n-   **data-v-max-size**: the input type file maximum file size (byte)\n-   **data-v-message**: alternative error mesage\n\n### Methods\n\n-   **validator**: add new custom validation\n-   **checkAll(formSelector = null, event = null)**: show errors without submitting the form, return error count\n-   **errorTrigger(inputSelector, message)**: show the error messages returned from the server.\n-   **reload()**: reload instance after dynamic element is added\n\n### Usage\n\nThe form's attribute have to novalidate `\u003cform novalidate\u003e`\n```javascript\n\u003cscript src=\"dist/jbvalidator.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    $(function (){\n\n        let validator = $('form.needs-validation').jbvalidator({\n            errorMessage: true,\n            successClass: true,\n            language: \"https://emretulek.github.io/jbvalidator/dist/lang/en.json\"\n        });\n\n        //custom validate methode\n        validator.validator.custom = function(el, event){\n            if($(el).is('[name=password]') \u0026\u0026 $(el).val().length \u003c 5){\n                return 'Your password is too weak.';\n            }\n        }\n\n        validator.validator.example = function(el, event){\n            if($(el).is('[name=username]') \u0026\u0026 $(el).val().length \u003c 3){\n                return 'Your username is too short.';\n            }\n        }\n\n        //check form without submit\n        validator.checkAll(); //return error count\n\n        //reload instance after dynamic element is added\n        validator.reload();\n    })\n\u003c/script\u003e\n```\n\n### Serverside validation\n\nYou can show the error messages returned from the server. The \".errorTrigger\" method can be used for this.\n\n.errorTrigger(element, message)\n\n```javascript\n\u003cscript src=\"dist/jbvalidator.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    $(function (){\n\n       let validatorServerSide = $('form.validatorServerSide').jbvalidator({\n            errorMessage: true,\n            successClass: false,\n        });\n\n        //serverside\n        $(document).on('submit', '.validatorServerSide', function(){\n\n            $.ajax({\n                method:\"get\",\n                url:\"http://jsvalidation.test/test.json\",\n                data: $(this).serialize(),\n                success: function (data){\n                    if(data.status === 'error') {\n                        validatorServerSide.errorTrigger($('[name=username]'), data.message);\n                    }\n                }\n            })\n\n            return false;\n        });\n    })\n\u003c/script\u003e\n```\n\n### Options\n\n```\n{\n    language: '', //json file url\n    errorMessage: true,\n    successClass: false,\n    html5BrowserDefault: false,\n    validFeedBackClass: 'valid-feedback',\n    invalidFeedBackClass: 'invalid-feedback',\n    validClass: 'is-valid',\n    invalidClass: 'is-invalid'\n}\n```\n\n### Language file content\n```\n{\n  \"maxValue\": \"Value must be less than or equal to %s.\",\n  \"minValue\": \"Value must be greater than or equal to %s.\",\n  \"maxLength\": \"Please lengthen this text to %s characters or less (you are currently using %s characters).\",\n  \"minLength\": \"Please lengthen this text to %s characters or more (you are currently using %s characters).\",\n  \"minSelectOption\": \"Please select at least %s options.\",\n  \"maxSelectOption\": \"Please select at most %s options.\",\n  \"groupCheckBox\": \"Please select at least %s options.\",\n  \"equal\": \"This field does not match with %s field.\",\n  \"fileMinSize\": \"File size cannot be less than %s bytes.\",\n  \"fileMaxSize\": \"File size cannot be more than %s bytes.\",\n  \"number\": \"Please enter a number.\",\n  \"HTML5\": {\n    \"valueMissing\": {\n      \"INPUT\": {\n        \"default\": \"Please fill out this field.\",\n        \"checkbox\": \"Please check this box.\",\n        \"radio\": \"Please select one of these options.\",\n        \"file\": \"Please select a file.\"\n      },\n      \"SELECT\": \"Please select an item in the list.\"\n    },\n    \"typeMismatch\": {\n      \"email\": \"Please enter an e-mail address.\",\n      \"url\": \"Please enter a URL.\"\n    },\n    \"rangeUnderflow\": {\n      \"date\": \"Value must be %s or later.\",\n      \"month\": \"Value must be %s or later.\",\n      \"week\": \"Value must be %s or later.\",\n      \"time\": \"Value must be %s or later.\",\n      \"datetimeLocale\": \"Value must be %s or later.\",\n      \"number\": \"Value must be greater than or equal to %s.\",\n      \"range\": \"Value must be greater than or equal to %s.\"\n    },\n    \"rangeOverflow\": {\n      \"date\": \"Value must be %s or earlier.\",\n      \"month\": \"Value must be %s or earlier.\",\n      \"week\": \"Value must be %s or earlier.\",\n      \"time\": \"Value must be %s or earlier.\",\n      \"datetimeLocale\": \"Value must be %s or earlier.\",\n      \"number\": \"Value must be less than or equal to %s.\",\n      \"range\": \"Value must be less than or equal to %s.\"\n    },\n    \"stepMismatch\": {\n      \"date\": \"You can only select every %s. day in the date calendar.\",\n      \"month\": \"You can only select every %s. month in the date calendar.\",\n      \"week\": \"You can only select every %s. week in the date calendar.\",\n      \"time\": \"You can only select every %s. second in the time picker.\",\n      \"datetimeLocale\": \"You can only select every %s. second in the time picker.\",\n      \"number\": \"Please enter a valid value. Only %s and a multiple of %s.\",\n      \"range\": \"Please enter a valid value. Only %s and a multiple of %s.\"\n    },\n    \"tooLong\": \"Please lengthen this text to %s characters or less (you are currently using %s characters).\",\n    \"tooShort\": \"Please lengthen this text to %s characters or more (you are currently using %s characters).\",\n    \"patternMismatch\": \"Please match the request format. %s\",\n    \"badInput\": {\n      \"number\": \"Please enter a number.\"\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femretulek%2Fjbvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femretulek%2Fjbvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femretulek%2Fjbvalidator/lists"}