{"id":16323676,"url":"https://github.com/mefellows/gvalidator","last_synced_at":"2025-08-07T14:38:35.665Z","repository":{"id":28595979,"uuid":"32114241","full_name":"mefellows/gvalidator","owner":"mefellows","description":"Automatically exported from code.google.com/p/gvalidator","archived":false,"fork":false,"pushed_at":"2015-03-14T04:33:07.000Z","size":404,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T21:13:25.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mefellows.png","metadata":{"files":{"readme":"readme.txt","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-13T01:17:14.000Z","updated_at":"2017-04-24T14:53:01.000Z","dependencies_parsed_at":"2022-08-21T19:10:45.505Z","dependency_job_id":null,"html_url":"https://github.com/mefellows/gvalidator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefellows%2Fgvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefellows%2Fgvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefellows%2Fgvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefellows%2Fgvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mefellows","download_url":"https://codeload.github.com/mefellows/gvalidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166156,"owners_count":20894652,"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":[],"created_at":"2024-10-10T22:55:23.696Z","updated_at":"2025-04-04T11:01:26.761Z","avatar_url":"https://github.com/mefellows.png","language":"JavaScript","readme":"GValidator (v0.5.49) - Javascript Validation library from OneGeek (http://www.onegeek.com.au)\n\n----------------------------------------------------------------\n\nGValidator is a lightweight javascript form validation library that automatically \nadds client-side validation to form elements, without needing to write a single line of javascript.\n\nThe aims of the project are to provide the following:\n\n\t  * A user-friendly experience\n    * A reusable and lightweight library            \n    * Semantically clean code \n    * Standards compliant code\n    * Cross browser compatibility\n    * Code flexibility and extensibility   \n    * promote adoption via ease of use\n\n\nHow to use GValidator (Simple Usage)\n----------------------------------------------------------------\nTo use the library all you need to do is:\n\n  * Copy the icons folder into your image directory\n  * Set the ICON_DIR variable in gvalidator.js to point to this location\n   \n      i.e. ICON_DIR = '/images/icons';\n  \n  * Include the gvalidator.css script file in the header of the page\n  \n     \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/css/gvalidator.css\" media=\"screen\"/\u003e\n    \n  * Include the gvalidator.js script file at the bottom of the page, just before \u003c/body\u003e\n  \n     i.e. \u003cscript type=\"text/javascript\" src=\"/js/gvalidator.js\"\u003e\u003c/script\u003e\n    \n  * The form is given a class attribute of \"gform\" to activate GValidator\n  * The fields for validation are given various obvious class names depending on how we wish to validate them. \n    i.e. class=\"name\", class=\"phone\", class=\"text\" etc.\n\nThere is no embedded JavaScript functions or invalid semantic markup here, just clean, straight-up XHTML.\n    \nAdvance GValidator usage\n----------------------------------------------------------------\nGValidator is quite flexible and extensible. It also provides a simple internationalization mechanisem.\n\n-- Configuration Options --\nGValidator has the following options, passed in to a variable with name 'ONEGEEK.forms.GValidator.options'.\nThis variable is a literal object, containing key/value pairs.\n  \n    Parameter        Accepted Values                 Description\n    ==========================================================================================================================================\n    reqShow          [Boolean]                       Automatically add the required char to labels?\n    reqChar          [String]                        Character used to indicate a required field\n    reqPlacement     ['after', 'before']             Position of required character. Can be 'before' or 'after'\n    autoFocus        [true,false]                    Automatically focus the first form element on page load\n    supressAlert     [Boolean]                       Supresses the javascript alert on an invalid form submission \n    highlightFields  [Boolean]                       Will apply a class name of 'highlight' to any invalid field on form submission attempt.    \n    \n    Element level messaging display options\n    ---------------------------------------\n    eMsgFormat       ['open','compact']              How to display messages next to the field. \n                                                     - 'open' refers to always showing the message\n                                                     - 'compact' only shows if the user performs an event on the field's icon.\n    eMsgEventOn      [String (DOM Event)]            Only used if eMsgFormat = 'compact'. Event used to trigger message display toggle\n    eMsgEventOff     [null, 'click', 'mouseout' ...] Only used if eMsgFormat = 'compact'. Event used to trigger message hide toggle. \n                                                     MUST NOT BE THE SAME AS 'eMsgEventOff' or they will cancel each other out\n    \n    Form level messaging display options\n    ------------------------------------\n    fMsgFormat       [null, String, Function]        How to display errors at the form level. \n                                                     - null displays an alert to the user indicating there are errors to be corrected. See fMsg to override default message.\n                                                     - String - Pass in an id reference to a container div to place the errors in as a \u003cul class=\"gvErrorsList\"\u003e\n                                                     - Function   - To do something custom on form submission error, pass in a function that accepts 1 parameter containing all of the error fields (ONEGEEK.forms.AbstractFormField[])   \n    fMsg             [String]                        A string alert to display on error i.e. \"Please correct the highlighted errors!\",\n\n    Image parameters for 'compact' messages\n    ------------------------------------------\n    icons: {\n      ok             [String]                        Path to the OK state icon\n      info           [String]                        Path to the INFO state icon\n      error:         [String]                        Path to the ERROR state icon\n    }\n\n-- Internationalization (I8N) --\nTo specify a language translation for a form, simply do the following:\n\n- apply the W3C attribute 'lang' to the \u003cform\u003e with the value of the Country to translate i.e. lang=\"DE\"\n- Create a variable with the name ONEGEEK.forms.GValidator.translation.\u003clang\u003e i.e. ONEGEEK.forms.GValidator.translation.DE\n- In that Object map, each top level key should correspend to an existing validator type, and the second-level key/value pairs for the different message types\n  To set defaults across ALL validator types, use the special top-level key 'defaults' i.e. \n\nONEGEEK.forms.GValidator.translation.DE = {  \n    defaults: {\n      successMsg: 'Danke',\n      contextMsg: 'Bitte füllen Sie',\n      errorMsg: 'Kaputt! Es wurde ein Fehler beim Überprüfen diesem Bereich',\n      emptyMessage: 'Pflichtfeld, füllen Sie bitte.',\n    },        \n    firstname: {\n      contextMsg: 'Wir möchten Sie von Ihrem Namen zu nennen'\n    },\n    ...\n};\n\n- To set the form level error message, override the 'fMsg' property like the following:\n\nONEGEEK.forms.GValidator.options = {  \n    fMsg: \"Bitte korrigieren Sie die markierten Fehler!\"\n};\n\n-- Extending GValidator (simple plugins) --\nExample of a new IP 4 Address validator:\n\nONEGEEK.forms.GValidator.plugins = {\n    ip4address: {\n        _extends:     'GenericTextField',\n        regex:        /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,\n        cleanRegex:   /[^0-9\\.]/g,\n        contextMessage: 'Please enter a valid IP 4 Address i.e. 127.0.0.1',\n        errorMessage: 'Please enter a valid IP 4 Address i.e. 127.0.0.1',   \n        successMessage: 'Thanks'  \n    }    \n};\n\n-- Extending GValidator (advanced) --\n See the documentation at www.onegeek.com.au for more details on this.\n    \nAlso\n----------------------------------------------------------------\nTo get the latest code, view or post bugs or learn more go to:\n * code.google.com/p/gvalidator\n\n\nGValidator Change Log\n----------------------------------------------------------------\n0.5.90\n--\n - Minor bug fix for single checkbox forms.\n\n0.5.49\n--\n\nMajor updates include:\n - Internationalisation and translation file support added.\n - Easy configuration, and form specific configuration via class names and id's\n - Simple plugin file support\n - Empty fields now have separate error messages\n - Form level validation can be passed to a function handler via configuration\n - Form level validation errors can be displayed in a container div via a configuration option\n - Element level configuration options\n - DEPRECATION of the following params\n   - ENABLE_COMPACT_MESSAGES (replace with config option eMsgFormat: 'compact')\n   - ICON_* (replaced by config options icons: {error: 'image/path', info...} ) \n\n0.4.30\n--\nBug fix (Issue 4). Generic text field did not take 'required' flag into consideration, and is now more closely related to AbstractTextField, in that it has a universal 'this.regex' predicate.\n\n\n0.4.25\n--\nGValidator now resets along with a form reset.\n\n\n0.4.20\n--\n Added ability to use the 'required' class for validation purposes.\n Elements can now have multiple classes (for non-GValidator purposes) and it won't affect the GValidator validation\n\n\n0.3.0\n--\n  Initial Release of GValidator on Google Code\n  \n  \nThanks\n----------------------------------------------------------------\nIcons in the example are provided by Fam Fam Fam (http://www.famfamfam.com/lab/icons/mini/)  ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefellows%2Fgvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefellows%2Fgvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefellows%2Fgvalidator/lists"}