{"id":20816074,"url":"https://github.com/arillo/silverstripe-jqueryformvalidator","last_synced_at":"2026-04-29T05:05:43.979Z","repository":{"id":11512126,"uuid":"13992336","full_name":"arillo/silverstripe-jqueryformvalidator","owner":"arillo","description":"jquery validator for Silverstripe CMS","archived":false,"fork":false,"pushed_at":"2013-10-30T17:42:01.000Z","size":236,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-12-27T13:32:20.798Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arillo.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}},"created_at":"2013-10-30T16:21:29.000Z","updated_at":"2013-11-05T12:29:04.000Z","dependencies_parsed_at":"2022-09-22T23:23:08.389Z","dependency_job_id":null,"html_url":"https://github.com/arillo/silverstripe-jqueryformvalidator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arillo/silverstripe-jqueryformvalidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-jqueryformvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-jqueryformvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-jqueryformvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-jqueryformvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arillo","download_url":"https://codeload.github.com/arillo/silverstripe-jqueryformvalidator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-jqueryformvalidator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32411585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T03:46:11.172Z","status":"ssl_error","status_checked_at":"2026-04-29T03:37:55.317Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-17T21:27:56.931Z","updated_at":"2026-04-29T05:05:43.945Z","avatar_url":"https://github.com/arillo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JQueryValidation\n\nAdds jquery.validation functionality to silverstripe 3.0+ forms.\nVisit http://jqueryvalidation.org/ for more information.\n\n## Usage\nTo make it work, make sure your page has jquery included. For sake of backward compartibilty for old browsers you also might load json2.js.\nBoth files can be found in modulefolder/javascript/libs.\n\nStart up validation on a form like this:\n\n\t$form = new Form(\n\t\t$this,\n\t\t'Form',\n\t\t$fields,\n\t\tnew FieldList(\n\t\t\tnew FormAction(\n\t\t\t\t'FormHandler',\n\t\t\t\t'Submit'\n\t\t\t)\n\t\t),\n\t\tRequiredFields::create(....)\n\t);\n\n### JQueryValidation::create($form, $config)\nExpects a form and an optional config array, which overrides values from the base config. Take a look into\nJQueryValidation::$base_config for available key / value pairs.\n\n\tJQueryValidation::create(\n\t\t$form,\n\t\tarray(\n\t\t\t'validator' =\u003e array(\n\t\t\t\t'errorElement' =\u003e 'div'\n\t\t\t)\n\t\t\t...\n\t\t\t..\n\t\t\t.\n\t\t)\n\t);\n\n### JQueryValidation-\u003egenerate()\nFor automated creation use:\n\n\t// This will inspect all form fields and add their validation methods.\n\t// It also will add required checks provided by the form's RequiredFields.\n\tJQueryValidation::create($form)-\u003egenerate();\n\n\t// It is also possible to provide custom error messages and behaviour through passing a config array like this:\n\tJQueryValidation::create($form)-\u003egenerate(array(\n\t\t'messages' =\u003e array(\n\t\t\t'CheckboxField_DATA' =\u003e array(\n\t\t\t\t'required' =\u003e 'Custom message'\n\t\t\t)\n\t\t)\n\t));\n\t// Expected hooks are messages, rules, groups.\n\n### JQueryValidation-\u003ecustom()\nIf you want to provide your own validation file you can use this:\n\n\tJQueryValidation::create($form)-\u003ecustom('path/to/your.js');\n\n\t// It is also possible to provide information about which additional js files should be loaded, like this:\n\tJQueryValidation::create($form)-\u003ecustom(\n\t\t'path/to/your.js',\n\t\tarray(\n\t\t\t'additionalMethods',\t// load additional-methods.min.js\n\t\t\t'metadata',\t\t\t\t// load jquery.metadata.js\n\t\t\t'moment',\t\t\t\t// load moment.min.js\n\t\t\t'date'\t\t\t\t\t// load date.js\n\t\t)\n\t);\n\n### Supported form fields\n\n* CheckboxField\n* ConfirmedPasswordField\n* DropdownField\n* DateField\n* DatetimeField\n* EmailField\n* PasswordField\n* OptionsetField\n* NumericField\n* UploadField\n* TimeField\n* TextareaField\n* TextField\n\n### Validation types jquery.validator ships\n\nStandard:\n\n* required – Makes the element required.\n* remote – Requests a resource to check the element for validity.\n* minlength – Makes the element require a given minimum length.\n* maxlength – Makes the element require a given maxmimum length.\n* rangelength – Makes the element require a given value range.\n* min – Makes the element require a given minimum.\n* max – Makes the element require a given maximum.\n* range – Makes the element require a given value range.\n* email – Makes the element require a valid email\n* url – Makes the element require a valid url\n* date – Makes the element require a date.\n* dateISO – Makes the element require an ISO date.\n* number – Makes the element require a decimal number.\n* digits – Makes the element require digits only.\n* creditcard – Makes the element require a credit card number.\n* equalTo – Requires the element to be the same as another one\n\nAdditional methods:\n\n* accept – Makes a file upload accept only specified mime-types.\n* extension – Makes the element require a certain file extension.\n* phoneUS – Validate for valid US phone number.\n\nSee http://jqueryvalidation.org/documentation/ for more info.\n\nSome of this methods are automatically invoked if JQueryValidation-\u003egenerate() is used.\nExtra functionality can be added by adding them into $custom parameter. The following example creates a\nfield which validates for an url:\n\n\t// adding a simple textfield to the field list\n\t$fields-\u003epush(\n\t\tTextField::create(\n\t\t\t'URL',\n\t\t\t'Your website'\n\t\t)\n\t);\n\t...\n\t..\n\t.\n\t// later, when starting the validation you can add url validtition to this field like this:\n\tJQueryValidation::create($form)\n\t\t-\u003egenerate(\n\t\t\tarray(\n\t\t\t\t'messages' =\u003e array(\n\t\t\t\t\t'URL' =\u003e array(\n\t\t\t\t\t\t'url' =\u003e 'Please enter a valid url.' // add error message\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'rules' =\u003e array(\n\t\t\t\t\t'URL' =\u003e array(\n\t\t\t\t\t\t'url' =\u003e true // add url validation\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t);\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fsilverstripe-jqueryformvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farillo%2Fsilverstripe-jqueryformvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fsilverstripe-jqueryformvalidator/lists"}