{"id":26154397,"url":"https://github.com/rcdmk/validaform3","last_synced_at":"2026-04-18T21:05:17.357Z","repository":{"id":1804170,"uuid":"2728198","full_name":"rcdmk/validaform3","owner":"rcdmk","description":"The all new generation of my javascript form validation tools. Now using jQuery and data attributes.","archived":false,"fork":false,"pushed_at":"2015-08-04T13:55:29.000Z","size":200,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T08:36:03.920Z","etag":null,"topics":["form-validation","jquery","unobtrusive-javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"caskroom/homebrew-cask","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcdmk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-07T18:25:01.000Z","updated_at":"2018-09-12T03:51:19.000Z","dependencies_parsed_at":"2022-09-09T07:30:41.900Z","dependency_job_id":null,"html_url":"https://github.com/rcdmk/validaform3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rcdmk/validaform3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fvalidaform3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fvalidaform3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fvalidaform3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fvalidaform3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcdmk","download_url":"https://codeload.github.com/rcdmk/validaform3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fvalidaform3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31984564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"ssl_error","status_checked_at":"2026-04-18T20:23:29.375Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["form-validation","jquery","unobtrusive-javascript"],"created_at":"2025-03-11T08:29:27.893Z","updated_at":"2026-04-18T21:05:17.339Z","avatar_url":"https://github.com/rcdmk.png","language":"JavaScript","readme":"\r\n# Validaform 3\r\n\r\nThis is a project for client-side javascript validation of form data\r\nbased on data attributes using jQuery 1.6+ to interface the DOM.\r\n\r\nThe intent of this project is to provide a easy to use validation\r\nkit that webdesigners can use without any programming knowledge.\r\nA non obstrusive way to validate your forms without mixing markup\r\nand scripts.\r\n\r\n\r\n## How to use:\r\n\r\n- Insert the script in the page:  \r\n\t`\u003cscript src=\"js/rcdmk-validaform3.js\"\u003e\u003c/script\u003e`\r\n\t\r\n- Add the attribute \"data-validaform\" to the form tag:  \r\n\t`\u003cform data-validaform=\"true\"\u003e`\r\n\t\r\n- Add the attributes to the fields  \r\n\t`\u003cinput data-vf-req=\"true\" data-vf-text=\"o e-mail\" ...`\r\n\t\r\n**Note:** Don't forget to include the jQuery library 1.5+\r\n\r\n  \r\n\r\n## Validation rules:\r\n\r\n\u003e**Notice:**  \r\n\u003e_Althrough this text is in english (or pretend to), all the date, time and number formatting is referenced as the ISO standards used in_ _Brazil__, other latin and some european countries:_\r\n\u003e\r\n\u003e**dates:** `dd/mm/yyyy` (25/12/2000)  \r\n\u003e**decimal separator:** `,` (_coma:_ 1,99)  \r\n\u003e**thousands separator:** `.` (_dot:_ 1.234.567)  \r\n\u003e**negative numbers:** `-` (_dash:_ -123 or -1.234,56)\r\n\u003e\r\n\u003e_There are plans to make extentions to change this formats in the future to make this script localizable or globalizable._\r\n\r\n\r\n###`data-vf-text`:\r\n\r\nThe text used for the validation message\r\n\r\n**Accepts:**\r\n\r\n_A string containing the article and name of the field to be used in the validation message._\r\n\r\n**Examples:**\r\n\r\n    data-vf-text=\"o e-mail\"\r\n    data-vf-text=\"a senha\"\r\n\r\n---\r\n###`data-vf-req`:\r\n\r\nMarks a field as required (non empty).\r\n\r\n\u003e **Note:** All fields that are not marked with this flag are considered valid if empty (non selected in case of selects, radios and checkboxes).\r\n\t\r\n**Accepts:**\r\n\r\n_Any non empty value will enable this flag.  \r\nFor checkboxes and multiple selects this can accept an integer representing the minimum number of options to be selected._\r\n\r\n**Examples:**\r\n\r\n    data-vf-req=\"true\"\r\n    data-vf-req=\"2\"\r\n\r\n---\r\n###`data-vf-size`:\r\n\r\nSpecify the exact size of the the field value.  \r\nA field with this attribute must have exactly the length specified\r\n\r\n**Accepts:**  \r\n\r\n_An integer greater then zero._\r\n\r\n**Exemples:**\r\n\r\n    data-vf-size=\"2\"\r\n    data-vf-size=\"14\"\r\n\r\n---\r\n###`data-vf-type`:\r\n\r\nSpecify the data type of the field, validating by its format.  \r\nUsed by other validations like range to specify the type of range (except `CPF` and `CNPJ`).  \r\nSome of these also impose a formating when typing like `money`. Other just restrict the input like `int`.\r\n\r\n**Accepts:**\r\n\r\n_`date`: Date format_  \r\nValidate the format of a date string like `22/03/2005`.  \r\nThis uses first a format check and then a parse check to validate the date, even for leap years.\r\n\r\n_`decimal`, `float` or `money`: Number with decimal places format_    \r\nValidate the format of formatted string numbers like `1.025,15`, `1025,15` or `1025`.  \r\nThe `money` format also applyies a format mask and input restriction to the input field propper for currency values.\r\n\r\n\r\n_`int` or `integer`: Integer number format_  \r\nValidate the format of integer string numbers like `1005`, `1.005` or `-1005`.\r\n\r\n_`email`: e-mail format_  \r\nValidate the format of the eletronic address with a complex _regular expression_  \r\n\r\n_`cpf`: CPF format_  \r\nValidate the format of the CPF number validating the checking digits  \r\n\r\n_`cnpj`: CNPJ format_  \r\nValidate the format of the CNPJ number validating the checking digits  \r\n\r\n\u003e**Note:** I know that many of you can realise that this can't guaranty that the e-mail is really valid, but it's always good to advice that this script only validates the format and don't check if the e-mail really exists.\r\n\r\n**Examples:**\r\n\r\n    data-vf-type=\"money\"\r\n    data-vf-type=\"int\"\r\n    data-vf-type=\"date\"\r\n\r\n---\r\n###`data-vf-range`\r\n\r\nSpecify the type of range validation to apply.\r\n\r\n**Accepts:**\r\n\r\n_The data types: `date` and all numeric data types._\r\n\r\n\r\n**Examples:**\r\n\r\n    data-vf-range=\"date\"\r\n    data-vf-range=\"int\"\r\n\r\n---\r\n###`data-vf-range-min`\r\n\r\nSpecify a minimum value for the input.  \r\nRelly on the `data-vf-range` attribute (if this is ommited, uses the `data-vf-type`) to apply the validation.\r\n\r\n\r\n**Accepts:**\r\n\r\n_A valid minimum value for the specified data type._\r\n\r\n\r\n**Examples:**\r\n\r\n    data-vf-range-min=\"1\" data-vf-range=\"int\"\r\n    data-vf-range-min=\"01/01/1930\" data-vf-type=\"date\"\r\n\r\n\r\n---\r\n###`data-vf-range-max`\r\n\r\nSpecify a maximum value for the input.  \r\nRelly on the `data-vf-range` attribute (if this is ommited, uses the `data-vf-type`) to apply the validation.\r\n\r\n\r\n**Accepts:**\r\n\r\n_A valid maximum value for the specified data type._\r\n\r\n\r\n**Examples:**\r\n\r\n    data-vf-range-max=\"100\" data-vf-range=\"int\"\r\n    data-vf-range-max=\"31/12/2029\" data-vf-type=\"date\"\r\n\r\n---\r\n###`data-vf-compare`:\r\n\r\nSpecify a field to compare the value with.\r\n\r\n**Accepts:**\r\n\r\n_A valid ID of other input in the page to compare the value with. Alerting for non matching values like on password retype fields._\r\n\r\n**Examples:**\r\n\r\n    data-vf-compare=\"IdOfAnotherField\"\r\n    data-vf-compare=\"verifyPassword\"\r\n\r\n---\r\n###`data-vf-mask-key`:\r\n\r\nSpecify a key character to be used as the placeholder characters of the mask formatting.\r\n\r\n**Accepts:**\r\n\r\n_Any non empty single character._\r\n\r\n**Default:** `#`\r\n\r\n\r\n###`data-vf-mask`:\r\n\r\nSpecify an input mask for the content like a date or telephone number.\r\n\r\n**Accepts:**\r\n\r\n_Any character sequence, representing the input mask with key/placehoder characters to be replaced by the entered text._\r\n\r\n**Examples:**\r\n\r\n    data-vf-mask=\"##/##/####\" (input: \"25122005\", output: \"25/12/2005\")\r\n    data-vf-mask=\"pn# @@@@@\" data-vf-mask-key=\"@\" (input: \"a1B2C\", output: \"pn# a1B2C\")\r\n\r\n---\r\n###`data-vf-allow`:\r\n\r\nSpecify a regular expression to validate the entered text, restricting the input.  \r\n\r\n**Accepts:**\r\n\r\n_A JavaScript regular expression string._\r\n\r\n**Examples:**\r\n\r\n    data-vf-allow=\"[0-9]\"\r\n    data-vf-allow=\"[a-zA-Z0-9]\"\r\n    data-vf-allow=\"[A-Z]\"\r\n\r\n\r\n\r\n## Plus\r\n\r\n**TEXTAREA `maxlength` support**  \r\n\r\nBy implementing this validation on a form, you instantly gain support for `maxlength` on `textarea` elements inside that form. You just have to include the `maxlength=\"someNumber\"` and it will work.\r\n\r\n\u003e**Note:** This will not be valid HTML 4 or XHTML.  \r\n\u003eHTML5 already have support for maxlength on textareas, so it's valid.\r\n\r\n\r\n**`String.prototype.trim()`**  \r\n\r\nSupport form the missing `trim()` function on strings (removes blank spaces from the beggining and end of a string).  \r\nJust call `someStringVar.trim()`.\r\n\r\n\r\n**`String.prototype.reverse()`**  \r\n\r\nSupport for the missing `reverse()` function on strings (reverses the string).  \r\nJust call `someStringVar.reverse()`.\r\n\r\n\r\n**Dinamyc binding or delagetion for dinamically created fields**\r\n\r\nIf you create a field dinamically (using simple DOM manipulations or AJAX) with the validation attributes, they will just work without calling any more code.  \r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdmk%2Fvalidaform3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcdmk%2Fvalidaform3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdmk%2Fvalidaform3/lists"}