First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,40 @@
{
"name": "jquery-validation",
"homepage": "http://jqueryvalidation.org/",
"repository": {
"type": "git",
"url": "git://github.com/jzaefferer/jquery-validation.git"
},
"authors": [
"Jörn Zaefferer <joern.zaefferer@gmail.com>"
],
"description": "Form validation made easy",
"main": "dist/jquery.validate.js",
"keywords": [
"forms",
"validation",
"validate"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"demo",
"lib"
],
"dependencies": {
"jquery": ">= 1.6.4"
},
"version": "1.13.1",
"_release": "1.13.1",
"_resolution": {
"type": "version",
"tag": "1.13.1",
"commit": "91f9b8a8597ae8f8164671aadf5a8ed7eefcf4e4"
},
"_source": "https://github.com/jzaefferer/jquery-validation.git",
"_target": "~1.13",
"_originalSource": "jquery-validation"
}

View file

@ -0,0 +1,33 @@
# Contributing to jQuery Validation Plugin
Thanks for contributing! Here's a few guidelines to help your contribution get landed.
1. Make sure the problem you're addressing is reproducible. Use jsbin.com or jsfiddle.net to provide a test page.
2. Follow the [jQuery style guide](http://contribute.jquery.com/style-guides/js)
3. Add or update unit tests along with your patch. Run the unit tests in at least one browser (see below).
4. Run `grunt` (see below) to check for linting and a few other issues.
5. Describe the change in your commit message and reference the ticket, like this: "Fixed delegate bug for dynamic-totals demo. Fixes #51". If you're adding a new localization file, use something like this: "Added croatian (HR) localization"
## Build setup
1. Install [NodeJS](http://nodejs.org).
2. Install the Grunt CLI To install by running `npm install -g grunt-cli`. More details are available on their website http://gruntjs.com/getting-started.
3. Install the NPM dependencies by running `npm install`.
4. The build can now be called by running `grunt`.
## Creating a new Additional Method
If you've wrote custom methods that you'd like to contribute to additional-methods.js:
1. Create a branch
2. Add the method as a new file in src/additional
3. (Optional) Add translations to src/localization
4. Send a pull request to the master branch.
## Unit Tests
To run unit tests, you should have a local webserver installed and pointing at your workspace. Then open `http://localhost/jquery-validation/test` to run the unit tests. Start with one browser while developing the fix, then run against others before committing. Usually latest Chrome, Firefox, Safari and Opera and a few IEs.
## Linting
To run JSHint and other tools, use `grunt`.

View file

@ -0,0 +1,186 @@
/*jshint node:true*/
module.exports = function(grunt) {
"use strict";
var banner,
umdStart,
umdMiddle,
umdEnd,
umdStandardDefine,
umdAdditionalDefine,
umdLocalizationDefine;
banner = "/*!\n" +
" * jQuery Validation Plugin v<%= pkg.version %>\n" +
" *\n" +
" * <%= pkg.homepage %>\n" +
" *\n" +
" * Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" +
" * Released under the <%= _.pluck(pkg.licenses, 'type').join(', ') %> license\n" +
" */\n";
// define UMD wrapper variables
umdStart = "(function( factory ) {\n" +
"\tif ( typeof define === \"function\" && define.amd ) {\n";
umdMiddle = "\t} else {\n" +
"\t\tfactory( jQuery );\n" +
"\t}\n" +
"}(function( $ ) {\n\n";
umdEnd = "\n}));";
umdStandardDefine = "\t\tdefine( [\"jquery\"], factory );\n";
umdAdditionalDefine = "\t\tdefine( [\"jquery\", \"./jquery.validate\"], factory );\n";
umdLocalizationDefine = "\t\tdefine( [\"jquery\", \"../jquery.validate\"], factory );\n";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
concat: {
// used to copy to dist folder
dist: {
options: {
banner: banner +
umdStart +
umdStandardDefine +
umdMiddle,
footer: umdEnd
},
files: {
"dist/jquery.validate.js": [ "src/core.js", "src/*.js" ]
}
},
extra: {
options: {
banner: banner +
umdStart +
umdAdditionalDefine +
umdMiddle,
footer: umdEnd
},
files: {
"dist/additional-methods.js": [ "src/additional/additional.js", "src/additional/*.js" ]
}
}
},
uglify: {
options: {
preserveComments: false,
banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
"<%= grunt.template.today('m/d/yyyy') %>\n" +
" * <%= pkg.homepage %>\n" +
" * Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"
},
dist: {
files: {
"dist/additional-methods.min.js": "dist/additional-methods.js",
"dist/jquery.validate.min.js": "dist/jquery.validate.js"
}
},
all: {
expand: true,
cwd: "dist/localization",
src: "**/*.js",
dest: "dist/localization",
ext: ".min.js"
}
},
compress: {
dist: {
options: {
mode: "zip",
level: 1,
archive: "dist/<%= pkg.name %>-<%= pkg.version %>.zip",
pretty: true
},
src: [
"changelog.txt",
"demo/**/*.*",
"dist/**/*.js",
"Gruntfile.js",
"lib/**/*.*",
"package.json",
"README.md",
"src/**/*.*",
"test/**/*.*"
]
}
},
qunit: {
files: "test/index.html"
},
jshint: {
options: {
jshintrc: true
},
core: {
src: "src/**/*.js"
},
test: {
src: "test/*.js"
},
grunt: {
src: "Gruntfile.js"
}
},
watch: {
options: {
atBegin: true
},
src: {
files: "<%= jshint.core.src %>",
tasks: [
"concat"
]
}
},
jscs: {
all: [ "<%= jshint.core.src %>", "<%= jshint.test.src %>", "<%= jshint.grunt.src %>" ]
},
copy: {
dist: {
options: {
// append UMD wrapper
process: function( content ) {
return umdStart + umdLocalizationDefine + umdMiddle + content + umdEnd;
}
},
src: "src/localization/*",
dest: "dist/localization",
expand: true,
flatten: true,
filter: "isFile"
}
},
replace: {
dist: {
src: "dist/**/*.min.js",
overwrite: true,
replacements: [
{
from: "./jquery.validate",
to: "./jquery.validate.min"
}
]
}
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-jscs");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-text-replace");
grunt.registerTask("default", [ "concat", "copy", "jscs", "jshint", "qunit" ]);
grunt.registerTask("release", [ "default", "uglify", "replace", "compress" ]);
grunt.registerTask("start", [ "concat", "watch" ]);
};

View file

@ -0,0 +1,72 @@
[jQuery Validation Plugin](http://jqueryvalidation.org/) - Form validation made easy
================================
[![Build Status](https://secure.travis-ci.org/jzaefferer/jquery-validation.png)](http://travis-ci.org/jzaefferer/jquery-validation)
[![devDependency Status](https://david-dm.org/jzaefferer/jquery-validation/dev-status.png?theme=shields.io)](https://david-dm.org/jzaefferer/jquery-validation#info=devDependencies)
The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy.
## [Help the project](http://pledgie.com/campaigns/18159)
[![Help the project](http://www.pledgie.com/campaigns/18159.png?skin_name=chrome)](http://pledgie.com/campaigns/18159)
This project is looking for help! [You can donate to the ongoing pledgie campaign](http://pledgie.com/campaigns/18159)
and help spread the word. If you've used the plugin, or plan to use, consider a donation - any amount will help.
You can find the plan for how to spend the money on the [pledgie page](http://pledgie.com/campaigns/18159).
## Getting Started
### Downloading the prebuilt files
Prebuilt files can be downloaded from http://jqueryvalidation.org/
### Downloading the latest changes
The unreleased development files can be obtained by:
1. [Downloading](https://github.com/jzaefferer/jquery-validation/archive/master.zip) or Forking this repository
2. [Setup the build](CONTRIBUTING.md#build-setup)
3. Run `grunt` to create the built files in the "dist" directory
### Including it on your page
Include jQuery and the plugin on a page. Then select a form to validate and call the `validate` method.
```html
<form>
<input required>
</form>
<script src="jquery.js"></script>
<script src="jquery.validate.js"></script>
<script>
$("form").validate();
</script>
```
Alternatively include jQuery and the plugin via requirejs in your module.
```js
define(["jquery", "jquery.validate"], function( $ ) {
$("form").validate();
});
```
For more information on how to setup a rules and customizations, [check the documentation](http://jqueryvalidation.org/documentation/).
## Reporting an Issue
**IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them.
1. Make sure the problem you're addressing is reproducible.
2. Use http://jsbin.com or http://jsfiddle.net to provide a test page.
3. Indicate what browsers the issue can be reproduced in. **Note: IE Compatibilty modes issues will not be addressed.**
4. What version of the plug-in is the issue reproducible in. Is it reproducible after updating to the latest version.
## Contributing
See the [Contributing Guide](CONTRIBUTING.md)
## License
Copyright (c) 2013 Jörn Zaefferer
Licensed under the MIT license.

View file

@ -0,0 +1,31 @@
{
"name": "jquery-validation",
"homepage": "http://jqueryvalidation.org/",
"repository": {
"type": "git",
"url": "git://github.com/jzaefferer/jquery-validation.git"
},
"authors": [
"Jörn Zaefferer <joern.zaefferer@gmail.com>"
],
"description": "Form validation made easy",
"main": "dist/jquery.validate.js",
"keywords": [
"forms",
"validation",
"validate"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"demo",
"lib"
],
"dependencies": {
"jquery": ">= 1.6.4"
},
"version": "1.13.1"
}

View file

@ -0,0 +1,34 @@
/*jshint node:true */
module.exports = function( Release ) {
function today() {
return new Date().toISOString().replace(/T.+/, "");
}
// also add version property to this
Release._jsonFiles.push( "validation.jquery.json" );
Release.define({
issueTracker: "github",
changelogShell: function() {
return Release.newVersion + " / " + today() + "\n==================\n\n";
},
generateArtifacts: function( done ) {
Release.exec( "grunt release", "Grunt command failed" );
done([
"dist/additional-methods.js",
"dist/additional-methods.min.js",
"dist/jquery.validate.js",
"dist/jquery.validate.min.js"
]);
},
// disable CDN publishing
cdnPublish: false,
// disable authors check
_checkAuthorsTxt: function() {}
});
};

View file

@ -0,0 +1,481 @@
1.13.1 / 2014-10-14
==================
## Core
* Allow 0 as value for autoCreateRanges
* Apply ignore setting to all validationTargetFor elements
* Don't trim value in min/max/rangelength methods
* Escape id/name before using it as a selector in errorsFor
* Explicit default for focusCleanup option
* Fix incorrect regexp for describedby matcher
* Ignore readonly as well as disabled fields
* Improve id escaping, store escaped id in describedby
* Use return value of submitHandler to allow or prevent form submit
## Additionals
* Add postalcodeBR method
* Fix pattern method when parameter is a string
1.13.0 / 2014-07-01
==================
## All
* Add plugin UMD wrapper
## Core
* Respect non-error aria-describedby and empty hidden errors
* Improve dateISO RegExp
* Added radio/checkbox to delegate click-event
* Use aria-describedby for non-label elements
* Register focusin, focusout and keyup also on radio/checkbox
* Fix normalization for rangelength attribute value
* Update elementValue method to deal with type="number" fields
* Use charAt instead of array notation on strings, to support IE8(?)
## Localization
* Fix sk translation of rangelength method
* Add Finnish methods
* Fixed GL number validation message
* Fixed ES number method validation message
* Added galician (GL)
* Fixed French messages for min and max methods
## Additionals
* Add statesUS method
* Fix dateITA method to deal with DST bug
* Add persian date method
* Add postalCodeCA method
* Add postalcodeIT method
1.12.0 / 2014-04-01
==================
* Add ARIA testing ([3d5658e](https://github.com/jzaefferer/jquery-validation/commit/3d5658e9e4825fab27198c256beed86f0bd12577))
* Add es-AR localization messages. ([7b30beb](https://github.com/jzaefferer/jquery-validation/commit/7b30beb8ebd218c38a55d26a63d529e16035c7a2))
* Add missing dots to 'es' and 'es_AR' messages. ([a2a653c](https://github.com/jzaefferer/jquery-validation/commit/a2a653cb68926ca034b4b09d742d275db934d040))
* Added Indonesian (ID) localization ([1d348bd](https://github.com/jzaefferer/jquery-validation/commit/1d348bdcb65807c71da8d0bfc13a97663631cd3a))
* Added NIF, NIE and CIF Spanish documents numbers validation ([#830](https://github.com/jzaefferer/jquery-validation/issues/830), [317c20f](https://github.com/jzaefferer/jquery-validation/commit/317c20fa9bb772770bb9b70d46c7081d7cfc6545))
* Added the current form to the context of the remote ajax request ([0a18ae6](https://github.com/jzaefferer/jquery-validation/commit/0a18ae65b9b6d877e3d15650a5c2617a9d2b11d5))
* Additionals: Update IBAN method, trim trailing whitespaces ([#970](https://github.com/jzaefferer/jquery-validation/issues/970), [347b04a](https://github.com/jzaefferer/jquery-validation/commit/347b04a7d4e798227405246a5de3fc57451d52e1))
* BIC method: Improve RegEx, {1} is always redundant. Closes gh-744 ([5cad6b4](https://github.com/jzaefferer/jquery-validation/commit/5cad6b493575e8a9a82470d17e0900c881130873))
* Bower: Add Bower.json for package registration ([e86ccb0](https://github.com/jzaefferer/jquery-validation/commit/e86ccb06e301613172d472cf15dd4011ff71b398))
* Changes dollar references to 'jQuery', for compability with jQuery.noConflict. Closes gh-754 ([2049afe](https://github.com/jzaefferer/jquery-validation/commit/2049afe46c1be7b3b89b1d9f0690f5bebf4fbf68))
* Core: Add "method" field to error list entry ([89a15c7](https://github.com/jzaefferer/jquery-validation/commit/89a15c7a4b17fa2caaf4ff817f09b04c094c3884))
* Core: Added support for generic messages via data-msg attribute ([5bebaa5](https://github.com/jzaefferer/jquery-validation/commit/5bebaa5c55c73f457c0e0181ec4e3b0c409e2a9d))
* Core: Allow attributes to have a value of zero (eg min='0') ([#854](https://github.com/jzaefferer/jquery-validation/issues/854), [9dc0d1d](https://github.com/jzaefferer/jquery-validation/commit/9dc0d1dd946b2c6178991fb16df0223c76162579))
* Core: Disable deprecated $.format ([#755](https://github.com/jzaefferer/jquery-validation/issues/755), [bf3b350](https://github.com/jzaefferer/jquery-validation/commit/bf3b3509140ea8ab5d83d3ec58fd9f1d7822efc5))
* Core: Fix support for multiple error classes ([c1f0baf](https://github.com/jzaefferer/jquery-validation/commit/c1f0baf36c21ca175bbc05fb9345e5b44b094821))
* Core: Ignore events on ignored elements ([#700](https://github.com/jzaefferer/jquery-validation/issues/700), [a864211](https://github.com/jzaefferer/jquery-validation/commit/a86421131ea69786ee9e0d23a68a54a7658ccdbf))
* Core: Improve elementValue method ([6c041ed](https://github.com/jzaefferer/jquery-validation/commit/6c041edd21af1425d12d06cdd1e6e32a78263e82))
* Core: Make element() handle ignored elements properly. ([3f464a8](https://github.com/jzaefferer/jquery-validation/commit/3f464a8da49dbb0e4881ada04165668e4a63cecb))
* Core: Switch dataRules parsing to W3C HTML5 spec style ([460fd22](https://github.com/jzaefferer/jquery-validation/commit/460fd22b6c84a74c825ce1fa860c0a9da20b56bb))
* Core: Trigger success on optional but have other successful validators ([#851](https://github.com/jzaefferer/jquery-validation/issues/851), [f93e1de](https://github.com/jzaefferer/jquery-validation/commit/f93e1deb48ec8b3a8a54e946a37db2de42d3aa2a))
* Core: Use plain element instead of un-wrapping the element again ([03cd4c9](https://github.com/jzaefferer/jquery-validation/commit/03cd4c93069674db5415a0bf174a5870da47e5d2))
* Core: make sure remote is executed last ([#711](https://github.com/jzaefferer/jquery-validation/issues/711), [ad91b6f](https://github.com/jzaefferer/jquery-validation/commit/ad91b6f388b7fdfb03b74e78554cbab9fd8fca6f))
* Demo: Use correct option in multipart demo. ([#1025](https://github.com/jzaefferer/jquery-validation/issues/1025), [070edc7](https://github.com/jzaefferer/jquery-validation/commit/070edc7be4de564cb74cfa9ee4e3f40b6b70b76f))
* Fix $/jQuery usage in additional methods. Fixes #839 ([#839](https://github.com/jzaefferer/jquery-validation/issues/839), [59bc899](https://github.com/jzaefferer/jquery-validation/commit/59bc899e4586255a4251903712e813c21d25b3e1))
* Improve Chinese translations ([1a0bfe3](https://github.com/jzaefferer/jquery-validation/commit/1a0bfe32b16f8912ddb57388882aa880fab04ffe))
* Initial ARIA-Required implementation ([bf3cfb2](https://github.com/jzaefferer/jquery-validation/commit/bf3cfb234ede2891d3f7e19df02894797dd7ba5e))
* Localization: change accept values to extension. Fixes #771, closes gh-793. ([#771](https://github.com/jzaefferer/jquery-validation/issues/771), [12edec6](https://github.com/jzaefferer/jquery-validation/commit/12edec66eb30dc7e86756222d455d49b34016f65))
* Messages: Add icelandic localization ([dc88575](https://github.com/jzaefferer/jquery-validation/commit/dc885753c8872044b0eaa1713cecd94c19d4c73d))
* Messages: Add missing dots to 'bg', 'fr' and 'sr' messages. ([adbc636](https://github.com/jzaefferer/jquery-validation/commit/adbc6361c377bf6b74c35df9782479b1115fbad7))
* Messages: Create messages_sr_lat.js ([f2f9007](https://github.com/jzaefferer/jquery-validation/commit/f2f90076518014d98495c2a9afb9a35d45d184e6))
* Messages: Create messages_tj.js ([de830b3](https://github.com/jzaefferer/jquery-validation/commit/de830b3fd8689a7384656c17565ee92c2878d8a5))
* Messages: Fix sr_lat translation, add missing space ([880ba1c](https://github.com/jzaefferer/jquery-validation/commit/880ba1ca545903a41d8c5332fc4038a7e9a580bd))
* Messages: Update messages_sr.js, fix missing space ([10313f4](https://github.com/jzaefferer/jquery-validation/commit/10313f418c18ea75f385248468c2d3600f136cfb))
* Methods: Add additional method for currency ([1a981b4](https://github.com/jzaefferer/jquery-validation/commit/1a981b440346620964c87ebdd0fa03246348390e))
* Methods: Adding Smart Quotes to stripHTML's punctuation removal ([aa0d624](https://github.com/jzaefferer/jquery-validation/commit/aa0d6241c3ea04663edc1e45ed6e6134630bdd2f))
* Methods: Fix dateITA method, avoiding summertime errors ([279b932](https://github.com/jzaefferer/jquery-validation/commit/279b932c1267b7238e6652880b7846ba3bbd2084))
* Methods: Localized methods for chilean culture (es-CL) ([cf36b93](https://github.com/jzaefferer/jquery-validation/commit/cf36b933499e435196d951401221d533a4811810))
* Methods: Update email to use HTML5 regex, remove email2 method ([#828](https://github.com/jzaefferer/jquery-validation/issues/828), [dd162ae](https://github.com/jzaefferer/jquery-validation/commit/dd162ae360639f73edd2dcf7a256710b2f5a4e64))
* Pattern method: Remove delimiters, since HTML5 implementations don't include those either. ([37992c1](https://github.com/jzaefferer/jquery-validation/commit/37992c1c9e2e0be8b315ccccc2acb74863439d3e))
* Restricting credit card validator to include length check. Closes gh-772 ([f5f47c5](https://github.com/jzaefferer/jquery-validation/commit/f5f47c5c661da5b0c0c6d59d169e82230928a804))
* Update messages_ko.js - closes gh-715 ([5da3085](https://github.com/jzaefferer/jquery-validation/commit/5da3085ff02e0e6ecc955a8bfc3bb9a8d220581b))
* Update messages_pt_BR.js. Closes gh-782 ([4bf813b](https://github.com/jzaefferer/jquery-validation/commit/4bf813b751ce34fac3c04eaa2e80f75da3461124))
* Update phonesUK and mobileUK to accept new prefixes. Closes gh-750 ([d447b41](https://github.com/jzaefferer/jquery-validation/commit/d447b41b830dee984be21d8281ec7b87a852001d))
* Verify nine-digit zip codes. Closes gh-726 ([165005d](https://github.com/jzaefferer/jquery-validation/commit/165005d4b5780e22d13d13189d107940c622a76f))
* phoneUS: Add N11 exclusions. Closes gh-861 ([519bbc6](https://github.com/jzaefferer/jquery-validation/commit/519bbc656bcb26e8aae5166d7b2e000014e0d12a))
* resetForm should clear any aria-invalid values ([4f8a631](https://github.com/jzaefferer/jquery-validation/commit/4f8a631cbe84f496ec66260ada52db2aa0bb3733))
* valid(): Check all elements. Fixes #791 - valid() validates only the first (invalid) element ([#791](https://github.com/jzaefferer/jquery-validation/issues/791), [6f26803](https://github.com/jzaefferer/jquery-validation/commit/6f268031afaf4e155424ee74dd11f6c47fbb8553))
1.11.1 / 2013-03-22
==================
* Revert to also converting parameters of range method to numbers. Closes gh-702
* Replace most usage of PHP with mockjax handlers. Do some demo cleanup as well, update to newer masked-input plugin. Keep captcha demo in PHP. Fixes #662
* Remove inline code highlighting from milk demo. View source works fine.
* Fix dynamic-totals demo by trimming whitespace from template content before passing to jQuery constructor
* Fix min/max validation. Closes gh-666. Fixes #648
* Fixed 'messages' coming up as a rule and causing an exception after being updated through rules("add"). Closes gh-670, fixes #624
* Add Korean (ko) localization. Closes gh-671
* Improved the UK postcode method to filter out more invalid postcodes. Closes #682
* Update messages_sv.js. Closes #683
* Change grunt link to the project website. Closes #684
* Move remote method down the list to run last, after all other methods applied to a field. Fixes #679
* Update plugin.json description, should include the word 'validate'
* Fix typos
* Fix jQuery loader to use path of itself. Fixes nested demos.
* Update grunt-contrib-qunit to make use of PhantomJS 1.8, when installed through node module 'phantomjs'
* Make valid() return a boolean instead of 0 or 1. Fixes #109 - valid() does not return boolean value
1.11.0 / 2013-02-04
==================
* Remove clearing as numbers of `min`, `max` and `range` rules. Fixes #455. Closes gh-528.
* Update pre-existing labels - fixes #430 closes gh-436
* Fix $.validator.format to avoid group interpolation, where at least IE8/9 replaces -bash with the match. Fixes #614
* Fix mimetype regex
* Add plugin manifest and update headers to just MIT license, drop unnecessary dual-licensing (like jQuery).
* Hebrew messages: Removed dots at end of sentences - Fixes gh-568
* French translation for require_from_group validation. Fixes gh-573.
* Allow groups to be an array or a string - Fixes #479
* Removed spaces with multiple MIME types
* Fix some date validations, JS syntax errors.
* Remove support for metadata plugin, replace with data-rule- and data-msg- (added in 907467e8) properties.
* Added sftp as a valid url-pattern
* Add Malay (my) localization
* Update localization/messages_hu.js
* Remove focusin/focusout polyfill. Fixes #542 - Inclusion of jquery.validate interfers with focusin and focusout events in IE9
* Localization: Fixed typo in finnish translation
* Fix RTM demo to show invalid icon when going from valid back to invalid
* Fixed premature return in remote function which prevented ajax call from being made in case an input was entered too quickly. Ensures remote validation always validates the newest value.
* Undo fix for #244. Fixes #521 - E-mail validation fires immediately when text is in the field.
1.10.0 / 2012-09-07
===================
* Corrected French strings for nowhitespace, phoneUS, phoneUK and mobileUK based upon community feedback.
* rename files for language_REGION according to the standard ISO_3166-1 (http://en.wikipedia.org/wiki/ISO_3166-1), for Taiwan tha language is Chinese (zh) and the region is Taiwan (TW)
* Optimise RegEx patterns, especially for UK phone numbers.
* Add Language Name for each file, rename the language code according to the standard ISO 639 for Estonian, Georgian, Ukrainian and Chinese (http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
* Added croatian (HR) localization
* Existing French translations were edited and French translations for the additional methods were added.
* Merged in changes for specifying custom error messages in data attributes
* Updated UK Mobile phone number regex for new numbers. Fixes #154
* Add element to success call with test. Fixes #60
* Fixed regex for time additional method. Fixes #131
* resetForm now clears old previousValue on form elements. Fixes #312
* Added checkbox test to require_from_group and changed require_from_group to use elementValue. Fixes #359
* Fixed dataFilter response issues in jQuery 1.5.2+. Fixes #405
* Added jQuery Mobile demo. Fixes #249
* Deoptimize findByName for correctness. Fixes #82 - $.validator.prototype.findByName breaks in IE7
* Added US zip code support and test. Fixes #90
* Changed lastElement to lastActive in keyup, skip validation on tab or empty element. Fixes #244
* Removed number stripping from stripHtml. Fixes #2
* Fixed invalid count on invalid to valid remote validation. Fixes #286
* Add link to file_input to demo index
* Moved old accept method to extension additional-method, added new accept method to handle standard browser mimetype filtering. Fixes #287 and supersedes #369
* Disables blur event when onfocusout is set to false. Test added.
* Fixed value issue for radio buttons and checkboxes. Fixes #363
* Added test for rangeWords and fixed regex and bounds in method. Fixes #308
* Fixed TinyMCE Demo and added link on demo page. Fixes #382
* Changed localization message for min/max. Fixes #273
* Added pseudo selector for text input types to fix issue with default empty type attribute. Added tests and some test markup. Fixes #217
* Fixed delegate bug for dynamic-totals demo. Fixes #51
* Fix incorrect message for alphanumeric validator
* Removed incorrect false check on required attribute
* required attribute fix for non-html5 browsers. Fixes #301
* Added methods "require_from_group" and "skip_or_fill_minimum"
* Use correct iso code for swedish
* Updated demo HTML files to use HTML5 doctype
* Fixed regex issue for decimals without leading zeroes. Added new methods test. Fixes #41
* Introduce a elementValue method that normalizes only string values (don't touch array value of multi-select). Fixes #116
* Support for dynamically added submit buttons, and updated test case. Uses validateDelegate. Code from PR #9
* Fix bad double quote in test fixtures
* Fix maxWords method to include the upper bound, not exclude it. Fixes #284
* Fixed grammar error in german range validator message. Fixes #315
* Fixed handling of multiple class names for errorClass option. Test by Max Lynch. Fixes #280
* Fix jQuery.format usage, should be $.validator.format. Fixes #329
* Methods for 'all' UK phone numbers + UK postcodes
* Pattern method: Convert string param to RegExp. Fixes issue #223
* grammar error in german localization file
* Added Estonian localization for messages
* Improve tooltip handling on themerollered demo
* Add type="text" to input fields without type attribute to please qSA
* Update themerollered demo to use tooltip to show errors as overlay.
* Update themerollered demo to use latest jQuery UI (along with newer jQuery version). Move code around to speed up page load.
* Fixed min error message broken in Japanese.
* Update form plugin to latest version. Enhance the ajaxSubmit demo.
* Drop dateDE and numberDE methods from classRuleSettings, leftover from moving those to localized methods
* Passing submit event to submitHandler callback
* Fixed #219 - Fix valid() on elements with dependency-callback or dependency-expression.
* Improve build to remove dist dir to ensure only the current release gets zipped up
1.9.0
---
* Added Basque (EU) localization
* Added Slovenian (SL) localization
* Fixed issue #127 - Finnish translations has one : instead of ;
* Fixed Russian localization, minor syntax issue
* Added in support for HTML5 input types, fixes #97
* Improved HTML5 support by setting novalidate attribute on the form, and reading the type attribute.
* Fixed showLabel() removing all classes from error element. Remove only settings.validClass. Fixes #151.
* Added 'pattern' to additional-methods to validate against arbitrary regular expressions.
* Improved email method to not allow the dot at the end (valid by RFC, but unwanted here). Fixes #143
* Fixed swedish and norwegian translations, min/max messages got switched. Fixes #181
* Fixed #184 - resetForm: should unset lastElement
* Fixed #71 - improve existing time method and add time12h method for 12h am/pm time format
* Fixed #177 - Fix validation of a single radio or checkbox input
* Fixed #189 - :hidden elements are now ignored by default
* Fixed #194 - Required as attribute fails if jQuery>=1.6 - Use .prop instead of .attr
* Fixed #47, #39, #32 - Allowed credit card numbers to contain spaces as well as dashes (spaces are commonly input by users).
1.8.1
---
* Added Thai (TH) localization, fixes #85
* Added Vietnamese (VI) localization, thanks Ngoc
* Fixed issue #78. Error/Valid styling applies to all radio buttons of same group for required validation.
* Don't use form.elements as that isn't supported in jQuery 1.6 anymore. Its buggy as hell anyway (IE6-8: form.elements === form).
1.8.0
---
* Improved NL localization (http://plugins.jquery.com/node/14120)
* Added Georgian (GE) localization, thanks Avtandil Kikabidze
* Added Serbian (SR) localization, thanks Aleksandar Milovac
* Added ipv4 and ipv6 to additional methods, thanks Natal Ngétal
* Added Japanese (JA) localization, thanks Bryan Meyerovich
* Added Catalan (CA) localization, thanks Xavier de Pedro
* Fixed missing var statements within for-in loops
* Fix for remote validation, where a formatted message got messed up (https://github.com/jzaefferer/jquery-validation/issues/11)
* Bugfixes for compatibility with jQuery 1.5.1, while maintaining backwards-compatibility
1.7
---
* Added Lithuanian (LT) localization
* Added Greek (EL) localization (http://plugins.jquery.com/node/12319)
* Added Latvian (LV) localization (http://plugins.jquery.com/node/12349)
* Added Hebrew (HE) localization (http://plugins.jquery.com/node/12039)
* Fixed Spanish (ES) localization (http://plugins.jquery.com/node/12696)
* Added jQuery UI themerolled demo
* Removed cmxform.js
* Fixed four missing semicolons (http://plugins.jquery.com/node/12639)
* Renamed phone-method in additional-methods.js to phoneUS
* Added phoneUK and mobileUK methods to additional-methods.js (http://plugins.jquery.com/node/12359)
* Deep extend options to avoid modifying multiple forms when using the rules-method on a single element (http://plugins.jquery.com/node/12411)
* Bugfixes for compatibility with jQuery 1.4.2, while maintaining backwards-compatibility
1.6
---
* Added Arabic (AR), Portuguese (PTPT), Persian (FA), Finnish (FI) and Bulgarian (BR) localization
* Updated Swedish (SE) localization (some missing html iso characters)
* Fixed $.validator.addMethod to properly handle empty string vs. undefined for the message argument
* Fixed two accidental global variables
* Enhanced min/max/rangeWords (in additional-methods.js) to strip html before counting; good when counting words in a richtext editor
* Added localized methods for DE, NL and PT, removing the dateDE and numberDE methods (use messages_de.js and methods_de.js with date and number methods instead)
* Fixed remote form submit synchronization, kudos to Matas Petrikas
* Improved interactive select validation, now validating also on click (via option or select, inconsistent across browsers); doesn't work in Safari, which doesn't trigger a click event at all on select elements; fixes http://plugins.jquery.com/node/11520
* Updated to latest form plugin (2.36), fixing http://plugins.jquery.com/node/11487
* Bind to blur event for equalTo target to revalidate when that target changes, fixes http://plugins.jquery.com/node/11450
* Simplified select validation, delegating to jQuery's val() method to get the select value; should fix http://plugins.jquery.com/node/11239
* Fixed default message for digits (http://plugins.jquery.com/node/9853)
* Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351)
* Fixed a missing semicolon in additional-methods.js (http://plugins.jquery.com/node/9233)
* Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195)
* Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144)
* Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612)
* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)
1.5.5
---
* Fix for http://plugins.jquery.com/node/8659
* Fixed trailing comma in messages_cs.js
1.5.4
---
* Fixed remote method bug (http://plugins.jquery.com/node/8658)
1.5.3
---
* Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624)
* Updated multipart demo to use latest jQuery UI accordion
* Added dateNL and time methods to additionalMethods.js
* Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization
* Moved jQuery.format (formerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details)
* Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4)
* Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481)
* Enhancement $.validator.addMethod: An undefined third message-argument won't overwrite an existing message (http://plugins.jquery.com/node/8443)
* Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183#comment-3585)
* Added option validClass, default "valid", which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205)
* Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635)
* Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807)
* Improved accept method to also accept a Drupal-style comma-separated list of values (http://plugins.jquery.com/node/8580)
1.5.2
---
* Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format
* Fixed value passed to methods to exclude carriage return (\r), same as jQuery's val() does
* Added slovak (sk) localization
* Added demo for integration with jQuery UI tabs
* Added selects-grouping example to tabs demo (see second tab, birthdate field)
1.5.1
---
* Updated marketo demo to use invalidHandler option instead of binding invalid-form event
* Added TinyMCE integration example
* Added ukrainian (ua) localization
* Fixed length validation to work with trimmed value (regression from 1.5 where general trimming before validation was removed)
* Various small fixes for compatibility with both 1.2.6 and 1.3
1.5
---
* Improved basic demo, validating confirm-password field after password changed
* Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming
* Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization
* Fixed #3195: Two flaws in swedish localization
* Fixed #3503: Extended rules("add") to accept messages property: use to specify add custom messages to an element via rules("add", { messages: { required: "Required! " } });
* Fixed #3356: Regression from #2908 when using meta-option
* Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compatibility
* Fixed #3516: Trigger invalid-form event even when remote validation is involved
* Added invalidHandler option as a shortcut to bind("invalid-form", function() {})
* Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide)
* Added test for creditcard validation and improved default message
* Enhanced remote validation, accepting options to passthrough to $.ajax as parameter (either url string or options, including url property plus everything else that $.ajax supports)
1.4
---
* Fixed #2931, validate elements in document order and ignore type=image inputs
* Fixed usage of $ and jQuery variables, now fully compatible with all variations of noConflict usage
* Implemented #2908, enabling custom messages via metadata ala class="{required:true,messages:{required:'required field'}}", added demo/custom-messages-metadata-demo.html
* Removed deprecated methods minValue (min), maxValue (max), rangeValue (rangevalue), minLength (minlength), maxLength (maxlength), rangeLength (rangelength)
* Fixed #2215 regression: Call unhighlight only for current elements, not everything
* Implemented #2989, enabling image button to cancel validation
* Fixed issue where IE incorrectly validates against maxlength=0
* Added czech (cs) localization
* Reset validator.submitted on validator.resetForm(), enabling a full reset when necessary
* Fixed #3035, skipping all falsy attributes when reading rules (0, undefined, empty string), removed part of the maxlength workaround (for 0)
* Added dutch (nl) localization (#3201)
1.3
---
* Fixed invalid-form event, now only triggered when form is invalid
* Added spanish (es), russian (ru), portuguese brazilian (ptbr), turkish (tr), and polish (pl) localization
* Added removeAttrs plugin to facilitate adding and removing multiple attributes
* Added groups option to display a single message for multiple elements, via groups: { arbitraryGroupName: "fieldName1 fieldName2[, fieldNameN" }
* Enhanced rules() for adding and removing (static) rules: rules("add", "method1[, methodN]"/{method1:param[, method_n:param]}) and rules("remove"[, "method1[, method_n]")
* Enhanced rules-option, accepts space-separated string-list of methods, eg. {birthdate: "required date"}
* Fixed checkbox group validation with inline rules: As long as the rules are specified on the first element, the group is now properly validated on click
* Fixed #2473, ignoring all rules with an explicit parameter of boolean-false, eg. required:false is the same as not specifying required at all (it was handled as required:true so far)
* Fixed #2424, with a modified patch from #2473: Methods returning a dependency-mismatch don't stop other rules from being evaluated anymore; still, success isn't applied for optional fields
* Fixed url and email validation to not use trimmed values
* Fixed creditcard validation to accept only digits and dashes ("asdf" is not a valid creditcard number)
* Allow both button and input elements for cancel buttons (via class="cancel")
* Fixed #2215: Fixed message display to call unhighlight as part of showing and hiding messages, no more visual side-effects while checking an element and extracted validator.checkForm to validate a form without UI sideeffects
* Rewrote custom selectors (:blank, :filled, :unchecked) with functions for compatibility with AIR
1.2.1
-----
* Bundled delegate plugin with validate plugin - its always required anyway
* Improved remote validation to include parts from the ajaxQueue plugin for proper synchronization (no additional plugin necessary)
* Fixed stopRequest to prevent pendingRequest < 0
* Added jQuery.validator.autoCreateRanges property, defaults to false, enable to convert min/max to range and minlength/maxlength to rangelength; this basically fixes the issue introduced by automatically creating ranges in 1.2
* Fixed optional-methods to not highlight anything at all if the field is blank, that is, don't trigger success
* Allow false/null for highlight/unhighlight options instead of forcing a do-nothing-callback even when nothing needs to be highlighted
* Fixed validate() call with no elements selected, returning undefined instead of throwing an error
* Improved demo, replacing metadata with classes/attributes for specifying rules
* Fixed error when no custom message is used for remote validation
* Modified email and url validation to require domain label and top label
* Fixed url and email validation to require TLD (actually to require domain label); 1.2 version (TLD is optional) is moved to additions as url2 and email2
* Fixed dynamic-totals demo in IE6/7 and improved templating, using textarea to store multiline template and string interpolation
* Added login form example with "Email password" link that makes the password field optional
* Enhanced dynamic-totals demo with an example of a single message for two fields
1.2
---
* Added AJAX-captcha validation example (based on http://psyrens.com/captcha/)
* Added remember-the-milk-demo (thanks RTM team for the permission!)
* Added marketo-demo (thanks Glen Lipka!)
* Added support for ajax-validation, see method "remote"; serverside returns JSON, true for valid elements, false or a String for invalid, String is used as message
* Added highlight and unhighlight options, by default toggles errorClass on element, allows custom highlighting
* Added valid() plugin method for easy programmatic checking of forms and fields without the need to use the validator API
* Added rules() plugin method to read and write rules for an element (currently read only)
* Replaced regex for email method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/email_address_validation/
* Restructured event architecture to rely solely on delegation, both improving performance, and ease-of-use for the developer (requires jquery.delegate.js)
* Moved documentation from inline to http://docs.jquery.com/Plugins/Validation - including interactive examples for all methods
* Removed validator.refresh(), validation is now completely dynamic
* Renamed minValue to min, maxValue to max and rangeValue to range, deprecating the previous names (to be removed in 1.3)
* Renamed minLength to minlength, maxLength to maxlength and rangeLength to rangelength, deprecating the previous names (to be removed in 1.3)
* Added feature to merge min + max into and range and minlength + maxlength into rangelength
* Added support for dynamic rule parameters, allowing to specify a function as a parameter eg. for minlength, called when validating the element
* Allow to specify null or an empty string as a message to display nothing (see marketo demo)
* Rules overhaul: Now supports combination of rules-option, metadata, classes (new) and attributes (new), see rules() for details
1.1.2
---
* Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/iri/
* Improved email method to better handle unicode characters
* Fixed error container to hide when all elements are valid, not only on form submit
* Fixed String.format to jQuery.format (moving into jQuery namespace)
* Fixed accept method to accept both upper and lowercase extensions
* Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times)
* Changed debug-mode console log from "error" to "warn" level
1.1.1
-----
* Fixed invalid XHTML, preventing error label creation in IE since jQuery 1.1.4
* Fixed and improved String.format: Global search & replace, better handling of array arguments
* Fixed cancel-button handling to use validator-object for storing state instead of form element
* Fixed name selectors to handle "complex" names, eg. containing brackets ("list[]")
* Added button and disabled elements to exclude from validation
* Moved element event handlers to refresh to be able to add handlers to new elements
* Fixed email validation to allow long top level domains (eg. ".travel")
* Moved showErrors() from valid() to form()
* Added validator.size(): returns the number of current errors
* Call submitHandler with validator as scope for easier access of it's methods, eg. to find error labels using errorsFor(Element)
* Compatible with jQuery 1.1.x and 1.2.x
1.1
---
* Added validation on blur, keyup and click (for checkboxes and radiobutton). Replaces event-option.
* Fixed resetForm
* Fixed custom-methods-demo
1.0
---
* Improved number and numberDE methods to check for correct decimal numbers with delimiters
* Only elements that have rules are checked (otherwise success-option is applied to all elements)
* Added creditcard number method (thanks to Brian Klug)
* Added ignore-option, eg. ignore: "[@type=hidden]", using that expression to exclude elements to validate. Default: none, though submit and reset buttons are always ignored
* Heavily enhanced Functions-as-messages by providing a flexible String.format helper
* Accept Functions as messages, providing runtime-custom-messages
* Fixed exclusion of elements without rules from successList
* Fixed custom-method-demo, replaced the alert with message displaying the number of errors
* Fixed form-submit-prevention when using submitHandler
* Completely removed dependency on element IDs, though they are still used (when present) to link error labels to inputs. Achieved by using
an array with {name, message, element} instead of an object with id:message pairs for the internal errorList.
* Added support for specifying simple rules as simple strings, eg. "required" is equivalent to {required: true}
* Added feature: Add errorClass to invalid field<6C>s parent element, making it easy to style the label/field container or the label for the field.
* Added feature: focusCleanup - If enabled, removes the errorClass from the invalid elements and hides all errors messages whenever the element is focused.
* Added success option to show the a field was validated successfully
* Fixed Opera select-issue (avoiding a attribute-collision)
* Fixed problems with focussing hidden elements in IE
* Added feature to skip validation for submit buttons with class "cancel"
* Fixed potential issues with Google Toolbar by preferring plugin option messages over title attribute
* submitHandler is only called when an actual submit event was handled, validator.form() returns false only for invalid forms
* Invalid elements are now focused only on submit or via validator.focusInvalid(), avoiding all trouble with focus-on-blur
* IE6 error container layout issue is solved
* Customize error element via errorElement option
* Added validator.refresh() to find new inputs in the form
* Added accept validation method, checks file extensions
* Improved dependency feature by adding two custom expressions: ":blank" to select elements with an empty value and <20>:filled<65> to select elements with a value, both excluding whitespace
* Added a resetForm() method to the validator: Resets each form element (using the form plugin, if available), removes classes on invalid elements and hides all error messages
* Fixed docs for validator.showErrors()
* Fixed error label creation to always use html() instead of text(), allowing arbitrary HTML passed in as messages
* Fixed error label creation to use specified error class
* Added dependency feature: The requires method accepts both String (jQuery expressions) and Functions as the argument
* Heavily improved customizing of error message display: Use normal messages and show/hide an additional container; Completely replace message display with own mechanism (while being able to delegate to the default handler; Customize placing of generated labels (instead of default below-element)
* Fixed two major bugs in IE (error containers) and Opera (metadata)
* Modified validation methods to accept empty fields as valid (exception: of course <20>required<65> and also <20>equalTo<54> methods)
* Renamed "min" to "minLength", "max" to "maxLength", "length" to "rangeLength"
* Added "minValue", "maxValue" and "rangeValue"
* Streamlined API for support of different events. The default, submit, can be disabled. If any event is specified, that is applied to each element (instead of the entire form). Combining keyup-validation with submit-validation is now extremely easy to setup
* Added support for one-message-per-rule when defining messages via plugin settings
* Added support to wrap metadata in some parent element. Useful when metadata is used for other plugins, too.
* Refactored tests and demos: Less files, better demos
* Improved documentation: More examples for methods, more reference texts explaining some basics

View file

@ -0,0 +1,940 @@
/*!
* jQuery Validation Plugin v1.13.1
*
* http://jqueryvalidation.org/
*
* Copyright (c) 2014 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
define( ["jquery", "./jquery.validate"], factory );
} else {
factory( jQuery );
}
}(function( $ ) {
(function() {
function stripHtml(value) {
// remove html tags and space chars
return value.replace(/<.[^<>]*?>/g, " ").replace(/&nbsp;|&#160;/gi, " ")
// remove punctuation
.replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "");
}
$.validator.addMethod("maxWords", function(value, element, params) {
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params;
}, $.validator.format("Please enter {0} words or less."));
$.validator.addMethod("minWords", function(value, element, params) {
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
}, $.validator.format("Please enter at least {0} words."));
$.validator.addMethod("rangeWords", function(value, element, params) {
var valueStripped = stripHtml(value),
regex = /\b\w+\b/g;
return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
}, $.validator.format("Please enter between {0} and {1} words."));
}());
// Accept a value from a file input based on a required mimetype
$.validator.addMethod("accept", function(value, element, param) {
// Split mime on commas in case we have multiple types we can accept
var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*",
optionalValue = this.optional(element),
i, file;
// Element is optional
if (optionalValue) {
return optionalValue;
}
if ($(element).attr("type") === "file") {
// If we are using a wildcard, make it regex friendly
typeParam = typeParam.replace(/\*/g, ".*");
// Check if the element has a FileList before checking each file
if (element.files && element.files.length) {
for (i = 0; i < element.files.length; i++) {
file = element.files[i];
// Grab the mimetype from the loaded file, verify it matches
if (!file.type.match(new RegExp( ".?(" + typeParam + ")$", "i"))) {
return false;
}
}
}
}
// Either return true because we've validated each file, or because the
// browser does not support element.files and the FileList feature
return true;
}, $.validator.format("Please enter a value with a valid mimetype."));
$.validator.addMethod("alphanumeric", function(value, element) {
return this.optional(element) || /^\w+$/i.test(value);
}, "Letters, numbers, and underscores only please");
/*
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
* and pass the '11 check'.
* We accept the notation with spaces, as that is common.
* acceptable: 123456789 or 12 34 56 789
*/
$.validator.addMethod("bankaccountNL", function(value, element) {
if (this.optional(element)) {
return true;
}
if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
return false;
}
// now '11 check'
var account = value.replace(/ /g, ""), // remove spaces
sum = 0,
len = account.length,
pos, factor, digit;
for ( pos = 0; pos < len; pos++ ) {
factor = len - pos;
digit = account.substring(pos, pos + 1);
sum = sum + factor * digit;
}
return sum % 11 === 0;
}, "Please specify a valid bank account number");
$.validator.addMethod("bankorgiroaccountNL", function(value, element) {
return this.optional(element) ||
($.validator.methods.bankaccountNL.call(this, value, element)) ||
($.validator.methods.giroaccountNL.call(this, value, element));
}, "Please specify a valid bank or giro account number");
/**
* BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
*
* BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional)
*
* BIC definition in detail:
* - First 4 characters - bank code (only letters)
* - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
* - Next 2 characters - location code (letters and digits)
* a. shall not start with '0' or '1'
* b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant)
* - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits)
*/
$.validator.addMethod("bic", function(value, element) {
return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value );
}, "Please specify a valid BIC code");
/*
* Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
* Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
*/
$.validator.addMethod( "cifES", function( value ) {
"use strict";
var num = [],
controlDigit, sum, i, count, tmp, secondDigit;
value = value.toUpperCase();
// Quick format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
return false;
}
for ( i = 0; i < 9; i++ ) {
num[ i ] = parseInt( value.charAt( i ), 10 );
}
// Algorithm for checking CIF codes
sum = num[ 2 ] + num[ 4 ] + num[ 6 ];
for ( count = 1; count < 8; count += 2 ) {
tmp = ( 2 * num[ count ] ).toString();
secondDigit = tmp.charAt( 1 );
sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) );
}
/* The first (position 1) is a letter following the following criteria:
* A. Corporations
* B. LLCs
* C. General partnerships
* D. Companies limited partnerships
* E. Communities of goods
* F. Cooperative Societies
* G. Associations
* H. Communities of homeowners in horizontal property regime
* J. Civil Societies
* K. Old format
* L. Old format
* M. Old format
* N. Nonresident entities
* P. Local authorities
* Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
* R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
* S. Organs of State Administration and regions
* V. Agrarian Transformation
* W. Permanent establishments of non-resident in Spain
*/
if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) {
sum += "";
controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 );
value += controlDigit;
return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) );
}
return false;
}, "Please specify a valid CIF number." );
/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
* Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
* Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
*/
$.validator.addMethod("creditcardtypes", function(value, element, param) {
if (/[^0-9\-]+/.test(value)) {
return false;
}
value = value.replace(/\D/g, "");
var validTypes = 0x0000;
if (param.mastercard) {
validTypes |= 0x0001;
}
if (param.visa) {
validTypes |= 0x0002;
}
if (param.amex) {
validTypes |= 0x0004;
}
if (param.dinersclub) {
validTypes |= 0x0008;
}
if (param.enroute) {
validTypes |= 0x0010;
}
if (param.discover) {
validTypes |= 0x0020;
}
if (param.jcb) {
validTypes |= 0x0040;
}
if (param.unknown) {
validTypes |= 0x0080;
}
if (param.all) {
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
}
if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard
return value.length === 16;
}
if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
return value.length === 16;
}
if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex
return value.length === 15;
}
if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub
return value.length === 14;
}
if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute
return value.length === 15;
}
if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
return value.length === 16;
}
if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
return value.length === 16;
}
if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
return value.length === 15;
}
if (validTypes & 0x0080) { //unknown
return true;
}
return false;
}, "Please enter a valid credit card number.");
/**
* Validates currencies with any given symbols by @jameslouiz
* Symbols can be optional or required. Symbols required by default
*
* Usage examples:
* currency: ["£", false] - Use false for soft currency validation
* currency: ["$", false]
* currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc
*
* <input class="currencyInput" name="currencyInput">
*
* Soft symbol checking
* currencyInput: {
* currency: ["$", false]
* }
*
* Strict symbol checking (default)
* currencyInput: {
* currency: "$"
* //OR
* currency: ["$", true]
* }
*
* Multiple Symbols
* currencyInput: {
* currency: "$,£,¢"
* }
*/
$.validator.addMethod("currency", function(value, element, param) {
var isParamString = typeof param === "string",
symbol = isParamString ? param : param[0],
soft = isParamString ? true : param[1],
regex;
symbol = symbol.replace(/,/g, "");
symbol = soft ? symbol + "]" : symbol + "]?";
regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";
regex = new RegExp(regex);
return this.optional(element) || regex.test(value);
}, "Please specify a valid currency");
$.validator.addMethod("dateFA", function(value, element) {
return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value);
}, "Please enter a correct date");
/**
* Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
*
* @example $.validator.methods.date("01/01/1900")
* @result true
*
* @example $.validator.methods.date("01/13/1990")
* @result false
*
* @example $.validator.methods.date("01.01.1900")
* @result false
*
* @example <input name="pippo" class="{dateITA:true}" />
* @desc Declares an optional input element whose value must be a valid date.
*
* @name $.validator.methods.dateITA
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("dateITA", function(value, element) {
var check = false,
re = /^\d{1,2}\/\d{1,2}\/\d{4}$/,
adata, gg, mm, aaaa, xdata;
if ( re.test(value)) {
adata = value.split("/");
gg = parseInt(adata[0], 10);
mm = parseInt(adata[1], 10);
aaaa = parseInt(adata[2], 10);
xdata = new Date(aaaa, mm - 1, gg, 12, 0, 0, 0);
if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) {
check = true;
} else {
check = false;
}
} else {
check = false;
}
return this.optional(element) || check;
}, "Please enter a correct date");
$.validator.addMethod("dateNL", function(value, element) {
return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
}, "Please enter a correct date");
// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept
$.validator.addMethod("extension", function(value, element, param) {
param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, $.validator.format("Please enter a value with a valid extension."));
/**
* Dutch giro account numbers (not bank numbers) have max 7 digits
*/
$.validator.addMethod("giroaccountNL", function(value, element) {
return this.optional(element) || /^[0-9]{1,7}$/.test(value);
}, "Please specify a valid giro account number");
/**
* IBAN is the international bank account number.
* It has a country - specific format, that is checked here too
*/
$.validator.addMethod("iban", function(value, element) {
// some quick simple tests to prevent needless work
if (this.optional(element)) {
return true;
}
// remove spaces and to upper case
var iban = value.replace(/ /g, "").toUpperCase(),
ibancheckdigits = "",
leadingZeroes = true,
cRest = "",
cOperator = "",
countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p;
if (!(/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(iban))) {
return false;
}
// check the country code and find the country specific format
countrycode = iban.substring(0, 2);
bbancountrypatterns = {
"AL": "\\d{8}[\\dA-Z]{16}",
"AD": "\\d{8}[\\dA-Z]{12}",
"AT": "\\d{16}",
"AZ": "[\\dA-Z]{4}\\d{20}",
"BE": "\\d{12}",
"BH": "[A-Z]{4}[\\dA-Z]{14}",
"BA": "\\d{16}",
"BR": "\\d{23}[A-Z][\\dA-Z]",
"BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
"CR": "\\d{17}",
"HR": "\\d{17}",
"CY": "\\d{8}[\\dA-Z]{16}",
"CZ": "\\d{20}",
"DK": "\\d{14}",
"DO": "[A-Z]{4}\\d{20}",
"EE": "\\d{16}",
"FO": "\\d{14}",
"FI": "\\d{14}",
"FR": "\\d{10}[\\dA-Z]{11}\\d{2}",
"GE": "[\\dA-Z]{2}\\d{16}",
"DE": "\\d{18}",
"GI": "[A-Z]{4}[\\dA-Z]{15}",
"GR": "\\d{7}[\\dA-Z]{16}",
"GL": "\\d{14}",
"GT": "[\\dA-Z]{4}[\\dA-Z]{20}",
"HU": "\\d{24}",
"IS": "\\d{22}",
"IE": "[\\dA-Z]{4}\\d{14}",
"IL": "\\d{19}",
"IT": "[A-Z]\\d{10}[\\dA-Z]{12}",
"KZ": "\\d{3}[\\dA-Z]{13}",
"KW": "[A-Z]{4}[\\dA-Z]{22}",
"LV": "[A-Z]{4}[\\dA-Z]{13}",
"LB": "\\d{4}[\\dA-Z]{20}",
"LI": "\\d{5}[\\dA-Z]{12}",
"LT": "\\d{16}",
"LU": "\\d{3}[\\dA-Z]{13}",
"MK": "\\d{3}[\\dA-Z]{10}\\d{2}",
"MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
"MR": "\\d{23}",
"MU": "[A-Z]{4}\\d{19}[A-Z]{3}",
"MC": "\\d{10}[\\dA-Z]{11}\\d{2}",
"MD": "[\\dA-Z]{2}\\d{18}",
"ME": "\\d{18}",
"NL": "[A-Z]{4}\\d{10}",
"NO": "\\d{11}",
"PK": "[\\dA-Z]{4}\\d{16}",
"PS": "[\\dA-Z]{4}\\d{21}",
"PL": "\\d{24}",
"PT": "\\d{21}",
"RO": "[A-Z]{4}[\\dA-Z]{16}",
"SM": "[A-Z]\\d{10}[\\dA-Z]{12}",
"SA": "\\d{2}[\\dA-Z]{18}",
"RS": "\\d{18}",
"SK": "\\d{20}",
"SI": "\\d{15}",
"ES": "\\d{20}",
"SE": "\\d{20}",
"CH": "\\d{5}[\\dA-Z]{12}",
"TN": "\\d{20}",
"TR": "\\d{5}[\\dA-Z]{17}",
"AE": "\\d{3}\\d{16}",
"GB": "[A-Z]{4}\\d{14}",
"VG": "[\\dA-Z]{4}\\d{16}"
};
bbanpattern = bbancountrypatterns[countrycode];
// As new countries will start using IBAN in the
// future, we only check if the countrycode is known.
// This prevents false negatives, while almost all
// false positives introduced by this, will be caught
// by the checksum validation below anyway.
// Strict checking should return FALSE for unknown
// countries.
if (typeof bbanpattern !== "undefined") {
ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
if (!(ibanregexp.test(iban))) {
return false; // invalid country specific format
}
}
// now check the checksum, first convert to digits
ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4);
for (i = 0; i < ibancheck.length; i++) {
charAt = ibancheck.charAt(i);
if (charAt !== "0") {
leadingZeroes = false;
}
if (!leadingZeroes) {
ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
}
}
// calculate the result of: ibancheckdigits % 97
for (p = 0; p < ibancheckdigits.length; p++) {
cChar = ibancheckdigits.charAt(p);
cOperator = "" + cRest + "" + cChar;
cRest = cOperator % 97;
}
return cRest === 1;
}, "Please specify a valid IBAN");
$.validator.addMethod("integer", function(value, element) {
return this.optional(element) || /^-?\d+$/.test(value);
}, "A positive or negative non-decimal number please");
$.validator.addMethod("ipv4", function(value, element) {
return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
}, "Please enter a valid IP v4 address.");
$.validator.addMethod("ipv6", function(value, element) {
return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
}, "Please enter a valid IP v6 address.");
$.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-z]+$/i.test(value);
}, "Letters only please");
$.validator.addMethod("letterswithbasicpunc", function(value, element) {
return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value);
}, "Letters or punctuation only please");
$.validator.addMethod("mobileNL", function(value, element) {
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
}, "Please specify a valid mobile number");
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
$.validator.addMethod("mobileUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
}, "Please specify a valid mobile number");
/*
* The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain
*/
$.validator.addMethod( "nieES", function( value ) {
"use strict";
value = value.toUpperCase();
// Basic format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
return false;
}
// Test NIE
//T
if ( /^[T]{1}/.test( value ) ) {
return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) );
}
//XYZ
if ( /^[XYZ]{1}/.test( value ) ) {
return (
value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
value.replace( "X", "0" )
.replace( "Y", "1" )
.replace( "Z", "2" )
.substring( 0, 8 ) % 23
)
);
}
return false;
}, "Please specify a valid NIE number." );
/*
* The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals
*/
$.validator.addMethod( "nifES", function( value ) {
"use strict";
value = value.toUpperCase();
// Basic format test
if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) {
return false;
}
// Test NIF
if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) {
return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) );
}
// Test specials NIF (starts with K, L or M)
if ( /^[KLM]{1}/.test( value ) ) {
return ( value[ 8 ] === String.fromCharCode( 64 ) );
}
return false;
}, "Please specify a valid NIF number." );
$.validator.addMethod("nowhitespace", function(value, element) {
return this.optional(element) || /^\S+$/i.test(value);
}, "No white space please");
/**
* Return true if the field value matches the given format RegExp
*
* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
* @result true
*
* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
* @result false
*
* @name $.validator.methods.pattern
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("pattern", function(value, element, param) {
if (this.optional(element)) {
return true;
}
if (typeof param === "string") {
param = new RegExp("^(?:" + param + ")$");
}
return param.test(value);
}, "Invalid format.");
/**
* Dutch phone numbers have 10 digits (or 11 and start with +31).
*/
$.validator.addMethod("phoneNL", function(value, element) {
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
}, "Please specify a valid phone number.");
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
$.validator.addMethod("phoneUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
}, "Please specify a valid phone number");
/**
* matches US phone number format
*
* where the area code may not start with 1 and the prefix may not start with 1
* allows '-' or ' ' as a separator and allows parens around area code
* some people may want to put a '1' in front of their number
*
* 1(212)-999-2345 or
* 212 999 2344 or
* 212-999-0983
*
* but not
* 111-123-5434
* and not
* 212 123 4567
*/
$.validator.addMethod("phoneUS", function(phone_number, element) {
phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/);
}, "Please specify a valid phone number");
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
$.validator.addMethod("phonesUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/);
}, "Please specify a valid uk phone number");
/**
* Matches a valid Canadian Postal Code
*
* @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element )
* @result true
*
* @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element )
* @result false
*
* @name jQuery.validator.methods.postalCodeCA
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod( "postalCodeCA", function( value, element ) {
return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value );
}, "Please specify a valid postal code" );
/*
* Valida CEPs do brasileiros:
*
* Formatos aceitos:
* 99999-999
* 99.999-999
* 99999999
*/
$.validator.addMethod("postalcodeBR", function(cep_value, element) {
return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value );
}, "Informe um CEP válido.");
/* Matches Italian postcode (CAP) */
$.validator.addMethod("postalcodeIT", function(value, element) {
return this.optional(element) || /^\d{5}$/.test(value);
}, "Please specify a valid postal code");
$.validator.addMethod("postalcodeNL", function(value, element) {
return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
}, "Please specify a valid postal code");
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
$.validator.addMethod("postcodeUK", function(value, element) {
return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
}, "Please specify a valid UK postcode");
/*
* Lets you say "at least X inputs that match selector Y must be filled."
*
* The end result is that neither of these inputs:
*
* <input class="productinfo" name="partnumber">
* <input class="productinfo" name="description">
*
* ...will validate unless at least one of them is filled.
*
* partnumber: {require_from_group: [1,".productinfo"]},
* description: {require_from_group: [1,".productinfo"]}
*
* options[0]: number of fields that must be filled in the group
* options[1]: CSS selector that defines the group of conditionally required fields
*/
$.validator.addMethod("require_from_group", function(value, element, options) {
var $fields = $(options[1], element.form),
$fieldsFirst = $fields.eq(0),
validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this),
isValid = $fields.filter(function() {
return validator.elementValue(this);
}).length >= options[0];
// Store the cloned validator for future validation
$fieldsFirst.data("valid_req_grp", validator);
// If element isn't being validated, run each require_from_group field's validation rules
if (!$(element).data("being_validated")) {
$fields.data("being_validated", true);
$fields.each(function() {
validator.element(this);
});
$fields.data("being_validated", false);
}
return isValid;
}, $.validator.format("Please fill at least {0} of these fields."));
/*
* Lets you say "either at least X inputs that match selector Y must be filled,
* OR they must all be skipped (left blank)."
*
* The end result, is that none of these inputs:
*
* <input class="productinfo" name="partnumber">
* <input class="productinfo" name="description">
* <input class="productinfo" name="color">
*
* ...will validate unless either at least two of them are filled,
* OR none of them are.
*
* partnumber: {skip_or_fill_minimum: [2,".productinfo"]},
* description: {skip_or_fill_minimum: [2,".productinfo"]},
* color: {skip_or_fill_minimum: [2,".productinfo"]}
*
* options[0]: number of fields that must be filled in the group
* options[1]: CSS selector that defines the group of conditionally required fields
*
*/
$.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
var $fields = $(options[1], element.form),
$fieldsFirst = $fields.eq(0),
validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this),
numberFilled = $fields.filter(function() {
return validator.elementValue(this);
}).length,
isValid = numberFilled === 0 || numberFilled >= options[0];
// Store the cloned validator for future validation
$fieldsFirst.data("valid_skip", validator);
// If element isn't being validated, run each skip_or_fill_minimum field's validation rules
if (!$(element).data("being_validated")) {
$fields.data("being_validated", true);
$fields.each(function() {
validator.element(this);
});
$fields.data("being_validated", false);
}
return isValid;
}, $.validator.format("Please either skip these fields or fill at least {0} of them."));
/* Validates US States and/or Territories by @jdforsythe
* Can be case insensitive or require capitalization - default is case insensitive
* Can include US Territories or not - default does not
* Can include US Military postal abbreviations (AA, AE, AP) - default does not
*
* Note: "States" always includes DC (District of Colombia)
*
* Usage examples:
*
* This is the default - case insensitive, no territories, no military zones
* stateInput: {
* caseSensitive: false,
* includeTerritories: false,
* includeMilitary: false
* }
*
* Only allow capital letters, no territories, no military zones
* stateInput: {
* caseSensitive: false
* }
*
* Case insensitive, include territories but not military zones
* stateInput: {
* includeTerritories: true
* }
*
* Only allow capital letters, include territories and military zones
* stateInput: {
* caseSensitive: true,
* includeTerritories: true,
* includeMilitary: true
* }
*
*
*
*/
jQuery.validator.addMethod("stateUS", function(value, element, options) {
var isDefault = typeof options === "undefined",
caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive,
includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories,
includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary,
regex;
if (!includeTerritories && !includeMilitary) {
regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
} else if (includeTerritories && includeMilitary) {
regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
} else if (includeTerritories) {
regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
} else {
regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
}
regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i");
return this.optional(element) || regex.test(value);
},
"Please specify a valid state");
// TODO check if value starts with <, otherwise don't try stripping anything
$.validator.addMethod("strippedminlength", function(value, element, param) {
return $(value).text().length >= param;
}, $.validator.format("Please enter at least {0} characters"));
$.validator.addMethod("time", function(value, element) {
return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(value);
}, "Please enter a valid time, between 00:00 and 23:59");
$.validator.addMethod("time12h", function(value, element) {
return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
}, "Please enter a valid time in 12-hour am/pm format");
// same as url, but TLD is optional
$.validator.addMethod("url2", function(value, element) {
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
}, $.validator.messages.url);
/**
* Return true, if the value is a valid vehicle identification number (VIN).
*
* Works with all kind of text inputs.
*
* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
* @desc Declares a required input element whose value must be a valid vehicle identification number.
*
* @name $.validator.methods.vinUS
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("vinUS", function(v) {
if (v.length !== 17) {
return false;
}
var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
rs = 0,
i, n, d, f, cd, cdv;
for (i = 0; i < 17; i++) {
f = FL[i];
d = v.slice(i, i + 1);
if (i === 8) {
cdv = d;
}
if (!isNaN(d)) {
d *= f;
} else {
for (n = 0; n < LL.length; n++) {
if (d.toUpperCase() === LL[n]) {
d = VL[n];
d *= f;
if (isNaN(cdv) && n === 8) {
cdv = LL[n];
}
break;
}
}
}
rs += d;
}
cd = rs % 11;
if (cd === 10) {
cd = "X";
}
if (cd === cdv) {
return true;
}
return false;
}, "The specified vehicle identification number (VIN) is invalid.");
$.validator.addMethod("zipcodeUS", function(value, element) {
return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value);
}, "The specified US ZIP Code is invalid");
$.validator.addMethod("ziprange", function(value, element) {
return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx");
}));

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,47 @@
{
"name": "jquery-validation",
"title": "jQuery Validation Plugin",
"description": "Form validation made easy",
"version": "1.13.1",
"homepage": "http://jqueryvalidation.org/",
"author": {
"name": "Jörn Zaefferer",
"email": "joern.zaefferer@gmail.com",
"url": "http://bassistance.de"
},
"repository": {
"type": "git",
"url": "git://github.com/jzaefferer/jquery-validation.git"
},
"bugs": {
"url": "https://github.com/jzaefferer/jquery-validation/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
}
],
"scripts": {
"test": "grunt"
},
"dependencies": {},
"devDependencies": {
"commitplease": "1.11.0",
"grunt": "0.4.4",
"grunt-contrib-compress": "0.7.0",
"grunt-contrib-concat": "0.3.0",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-qunit": "0.4.0",
"grunt-contrib-uglify": "0.4.0",
"grunt-contrib-watch": "0.6.0",
"grunt-jscs": "^0.6.1",
"grunt-text-replace": "0.3.11"
},
"keywords": [
"forms",
"validation",
"validate"
]
}

View file

@ -0,0 +1,33 @@
// Accept a value from a file input based on a required mimetype
$.validator.addMethod("accept", function(value, element, param) {
// Split mime on commas in case we have multiple types we can accept
var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*",
optionalValue = this.optional(element),
i, file;
// Element is optional
if (optionalValue) {
return optionalValue;
}
if ($(element).attr("type") === "file") {
// If we are using a wildcard, make it regex friendly
typeParam = typeParam.replace(/\*/g, ".*");
// Check if the element has a FileList before checking each file
if (element.files && element.files.length) {
for (i = 0; i < element.files.length; i++) {
file = element.files[i];
// Grab the mimetype from the loaded file, verify it matches
if (!file.type.match(new RegExp( ".?(" + typeParam + ")$", "i"))) {
return false;
}
}
}
}
// Either return true because we've validated each file, or because the
// browser does not support element.files and the FileList feature
return true;
}, $.validator.format("Please enter a value with a valid mimetype."));

View file

@ -0,0 +1,24 @@
(function() {
function stripHtml(value) {
// remove html tags and space chars
return value.replace(/<.[^<>]*?>/g, " ").replace(/&nbsp;|&#160;/gi, " ")
// remove punctuation
.replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "");
}
$.validator.addMethod("maxWords", function(value, element, params) {
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params;
}, $.validator.format("Please enter {0} words or less."));
$.validator.addMethod("minWords", function(value, element, params) {
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
}, $.validator.format("Please enter at least {0} words."));
$.validator.addMethod("rangeWords", function(value, element, params) {
var valueStripped = stripHtml(value),
regex = /\b\w+\b/g;
return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
}, $.validator.format("Please enter between {0} and {1} words."));
}());

View file

@ -0,0 +1,3 @@
$.validator.addMethod("alphanumeric", function(value, element) {
return this.optional(element) || /^\w+$/i.test(value);
}, "Letters, numbers, and underscores only please");

View file

@ -0,0 +1,25 @@
/*
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
* and pass the '11 check'.
* We accept the notation with spaces, as that is common.
* acceptable: 123456789 or 12 34 56 789
*/
$.validator.addMethod("bankaccountNL", function(value, element) {
if (this.optional(element)) {
return true;
}
if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
return false;
}
// now '11 check'
var account = value.replace(/ /g, ""), // remove spaces
sum = 0,
len = account.length,
pos, factor, digit;
for ( pos = 0; pos < len; pos++ ) {
factor = len - pos;
digit = account.substring(pos, pos + 1);
sum = sum + factor * digit;
}
return sum % 11 === 0;
}, "Please specify a valid bank account number");

View file

@ -0,0 +1,5 @@
$.validator.addMethod("bankorgiroaccountNL", function(value, element) {
return this.optional(element) ||
($.validator.methods.bankaccountNL.call(this, value, element)) ||
($.validator.methods.giroaccountNL.call(this, value, element));
}, "Please specify a valid bank or giro account number");

View file

@ -0,0 +1,16 @@
/**
* BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
*
* BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional)
*
* BIC definition in detail:
* - First 4 characters - bank code (only letters)
* - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
* - Next 2 characters - location code (letters and digits)
* a. shall not start with '0' or '1'
* b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant)
* - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits)
*/
$.validator.addMethod("bic", function(value, element) {
return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value );
}, "Please specify a valid BIC code");

View file

@ -0,0 +1,61 @@
/*
* Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
* Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
*/
$.validator.addMethod( "cifES", function( value ) {
"use strict";
var num = [],
controlDigit, sum, i, count, tmp, secondDigit;
value = value.toUpperCase();
// Quick format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
return false;
}
for ( i = 0; i < 9; i++ ) {
num[ i ] = parseInt( value.charAt( i ), 10 );
}
// Algorithm for checking CIF codes
sum = num[ 2 ] + num[ 4 ] + num[ 6 ];
for ( count = 1; count < 8; count += 2 ) {
tmp = ( 2 * num[ count ] ).toString();
secondDigit = tmp.charAt( 1 );
sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) );
}
/* The first (position 1) is a letter following the following criteria:
* A. Corporations
* B. LLCs
* C. General partnerships
* D. Companies limited partnerships
* E. Communities of goods
* F. Cooperative Societies
* G. Associations
* H. Communities of homeowners in horizontal property regime
* J. Civil Societies
* K. Old format
* L. Old format
* M. Old format
* N. Nonresident entities
* P. Local authorities
* Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
* R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
* S. Organs of State Administration and regions
* V. Agrarian Transformation
* W. Permanent establishments of non-resident in Spain
*/
if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) {
sum += "";
controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 );
value += controlDigit;
return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) );
}
return false;
}, "Please specify a valid CIF number." );

View file

@ -0,0 +1,69 @@
/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
* Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
* Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
*/
$.validator.addMethod("creditcardtypes", function(value, element, param) {
if (/[^0-9\-]+/.test(value)) {
return false;
}
value = value.replace(/\D/g, "");
var validTypes = 0x0000;
if (param.mastercard) {
validTypes |= 0x0001;
}
if (param.visa) {
validTypes |= 0x0002;
}
if (param.amex) {
validTypes |= 0x0004;
}
if (param.dinersclub) {
validTypes |= 0x0008;
}
if (param.enroute) {
validTypes |= 0x0010;
}
if (param.discover) {
validTypes |= 0x0020;
}
if (param.jcb) {
validTypes |= 0x0040;
}
if (param.unknown) {
validTypes |= 0x0080;
}
if (param.all) {
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
}
if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard
return value.length === 16;
}
if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
return value.length === 16;
}
if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex
return value.length === 15;
}
if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub
return value.length === 14;
}
if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute
return value.length === 15;
}
if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
return value.length === 16;
}
if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
return value.length === 16;
}
if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
return value.length === 15;
}
if (validTypes & 0x0080) { //unknown
return true;
}
return false;
}, "Please enter a valid credit card number.");

View file

@ -0,0 +1,41 @@
/**
* Validates currencies with any given symbols by @jameslouiz
* Symbols can be optional or required. Symbols required by default
*
* Usage examples:
* currency: ["£", false] - Use false for soft currency validation
* currency: ["$", false]
* currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc
*
* <input class="currencyInput" name="currencyInput">
*
* Soft symbol checking
* currencyInput: {
* currency: ["$", false]
* }
*
* Strict symbol checking (default)
* currencyInput: {
* currency: "$"
* //OR
* currency: ["$", true]
* }
*
* Multiple Symbols
* currencyInput: {
* currency: "$,£,¢"
* }
*/
$.validator.addMethod("currency", function(value, element, param) {
var isParamString = typeof param === "string",
symbol = isParamString ? param : param[0],
soft = isParamString ? true : param[1],
regex;
symbol = symbol.replace(/,/g, "");
symbol = soft ? symbol + "]" : symbol + "]?";
regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";
regex = new RegExp(regex);
return this.optional(element) || regex.test(value);
}, "Please specify a valid currency");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("dateFA", function(value, element) {
return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value);
}, "Please enter a correct date");

View file

@ -0,0 +1,39 @@
/**
* Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
*
* @example $.validator.methods.date("01/01/1900")
* @result true
*
* @example $.validator.methods.date("01/13/1990")
* @result false
*
* @example $.validator.methods.date("01.01.1900")
* @result false
*
* @example <input name="pippo" class="{dateITA:true}" />
* @desc Declares an optional input element whose value must be a valid date.
*
* @name $.validator.methods.dateITA
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("dateITA", function(value, element) {
var check = false,
re = /^\d{1,2}\/\d{1,2}\/\d{4}$/,
adata, gg, mm, aaaa, xdata;
if ( re.test(value)) {
adata = value.split("/");
gg = parseInt(adata[0], 10);
mm = parseInt(adata[1], 10);
aaaa = parseInt(adata[2], 10);
xdata = new Date(aaaa, mm - 1, gg, 12, 0, 0, 0);
if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) {
check = true;
} else {
check = false;
}
} else {
check = false;
}
return this.optional(element) || check;
}, "Please enter a correct date");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("dateNL", function(value, element) {
return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
}, "Please enter a correct date");

View file

@ -0,0 +1,5 @@
// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept
$.validator.addMethod("extension", function(value, element, param) {
param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, $.validator.format("Please enter a value with a valid extension."));

View file

@ -0,0 +1,6 @@
/**
* Dutch giro account numbers (not bank numbers) have max 7 digits
*/
$.validator.addMethod("giroaccountNL", function(value, element) {
return this.optional(element) || /^[0-9]{1,7}$/.test(value);
}, "Please specify a valid giro account number");

View file

@ -0,0 +1,126 @@
/**
* IBAN is the international bank account number.
* It has a country - specific format, that is checked here too
*/
$.validator.addMethod("iban", function(value, element) {
// some quick simple tests to prevent needless work
if (this.optional(element)) {
return true;
}
// remove spaces and to upper case
var iban = value.replace(/ /g, "").toUpperCase(),
ibancheckdigits = "",
leadingZeroes = true,
cRest = "",
cOperator = "",
countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p;
if (!(/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(iban))) {
return false;
}
// check the country code and find the country specific format
countrycode = iban.substring(0, 2);
bbancountrypatterns = {
"AL": "\\d{8}[\\dA-Z]{16}",
"AD": "\\d{8}[\\dA-Z]{12}",
"AT": "\\d{16}",
"AZ": "[\\dA-Z]{4}\\d{20}",
"BE": "\\d{12}",
"BH": "[A-Z]{4}[\\dA-Z]{14}",
"BA": "\\d{16}",
"BR": "\\d{23}[A-Z][\\dA-Z]",
"BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
"CR": "\\d{17}",
"HR": "\\d{17}",
"CY": "\\d{8}[\\dA-Z]{16}",
"CZ": "\\d{20}",
"DK": "\\d{14}",
"DO": "[A-Z]{4}\\d{20}",
"EE": "\\d{16}",
"FO": "\\d{14}",
"FI": "\\d{14}",
"FR": "\\d{10}[\\dA-Z]{11}\\d{2}",
"GE": "[\\dA-Z]{2}\\d{16}",
"DE": "\\d{18}",
"GI": "[A-Z]{4}[\\dA-Z]{15}",
"GR": "\\d{7}[\\dA-Z]{16}",
"GL": "\\d{14}",
"GT": "[\\dA-Z]{4}[\\dA-Z]{20}",
"HU": "\\d{24}",
"IS": "\\d{22}",
"IE": "[\\dA-Z]{4}\\d{14}",
"IL": "\\d{19}",
"IT": "[A-Z]\\d{10}[\\dA-Z]{12}",
"KZ": "\\d{3}[\\dA-Z]{13}",
"KW": "[A-Z]{4}[\\dA-Z]{22}",
"LV": "[A-Z]{4}[\\dA-Z]{13}",
"LB": "\\d{4}[\\dA-Z]{20}",
"LI": "\\d{5}[\\dA-Z]{12}",
"LT": "\\d{16}",
"LU": "\\d{3}[\\dA-Z]{13}",
"MK": "\\d{3}[\\dA-Z]{10}\\d{2}",
"MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
"MR": "\\d{23}",
"MU": "[A-Z]{4}\\d{19}[A-Z]{3}",
"MC": "\\d{10}[\\dA-Z]{11}\\d{2}",
"MD": "[\\dA-Z]{2}\\d{18}",
"ME": "\\d{18}",
"NL": "[A-Z]{4}\\d{10}",
"NO": "\\d{11}",
"PK": "[\\dA-Z]{4}\\d{16}",
"PS": "[\\dA-Z]{4}\\d{21}",
"PL": "\\d{24}",
"PT": "\\d{21}",
"RO": "[A-Z]{4}[\\dA-Z]{16}",
"SM": "[A-Z]\\d{10}[\\dA-Z]{12}",
"SA": "\\d{2}[\\dA-Z]{18}",
"RS": "\\d{18}",
"SK": "\\d{20}",
"SI": "\\d{15}",
"ES": "\\d{20}",
"SE": "\\d{20}",
"CH": "\\d{5}[\\dA-Z]{12}",
"TN": "\\d{20}",
"TR": "\\d{5}[\\dA-Z]{17}",
"AE": "\\d{3}\\d{16}",
"GB": "[A-Z]{4}\\d{14}",
"VG": "[\\dA-Z]{4}\\d{16}"
};
bbanpattern = bbancountrypatterns[countrycode];
// As new countries will start using IBAN in the
// future, we only check if the countrycode is known.
// This prevents false negatives, while almost all
// false positives introduced by this, will be caught
// by the checksum validation below anyway.
// Strict checking should return FALSE for unknown
// countries.
if (typeof bbanpattern !== "undefined") {
ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
if (!(ibanregexp.test(iban))) {
return false; // invalid country specific format
}
}
// now check the checksum, first convert to digits
ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4);
for (i = 0; i < ibancheck.length; i++) {
charAt = ibancheck.charAt(i);
if (charAt !== "0") {
leadingZeroes = false;
}
if (!leadingZeroes) {
ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
}
}
// calculate the result of: ibancheckdigits % 97
for (p = 0; p < ibancheckdigits.length; p++) {
cChar = ibancheckdigits.charAt(p);
cOperator = "" + cRest + "" + cChar;
cRest = cOperator % 97;
}
return cRest === 1;
}, "Please specify a valid IBAN");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("integer", function(value, element) {
return this.optional(element) || /^-?\d+$/.test(value);
}, "A positive or negative non-decimal number please");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("ipv4", function(value, element) {
return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
}, "Please enter a valid IP v4 address.");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("ipv6", function(value, element) {
return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
}, "Please enter a valid IP v6 address.");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-z]+$/i.test(value);
}, "Letters only please");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("letterswithbasicpunc", function(value, element) {
return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value);
}, "Letters or punctuation only please");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("mobileNL", function(value, element) {
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
}, "Please specify a valid mobile number");

View file

@ -0,0 +1,13 @@
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
$.validator.addMethod("mobileUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
}, "Please specify a valid mobile number");

View file

@ -0,0 +1,34 @@
/*
* The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain
*/
$.validator.addMethod( "nieES", function( value ) {
"use strict";
value = value.toUpperCase();
// Basic format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
return false;
}
// Test NIE
//T
if ( /^[T]{1}/.test( value ) ) {
return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) );
}
//XYZ
if ( /^[XYZ]{1}/.test( value ) ) {
return (
value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
value.replace( "X", "0" )
.replace( "Y", "1" )
.replace( "Z", "2" )
.substring( 0, 8 ) % 23
)
);
}
return false;
}, "Please specify a valid NIE number." );

View file

@ -0,0 +1,25 @@
/*
* The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals
*/
$.validator.addMethod( "nifES", function( value ) {
"use strict";
value = value.toUpperCase();
// Basic format test
if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) {
return false;
}
// Test NIF
if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) {
return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) );
}
// Test specials NIF (starts with K, L or M)
if ( /^[KLM]{1}/.test( value ) ) {
return ( value[ 8 ] === String.fromCharCode( 64 ) );
}
return false;
}, "Please specify a valid NIF number." );

View file

@ -0,0 +1,3 @@
$.validator.addMethod("nowhitespace", function(value, element) {
return this.optional(element) || /^\S+$/i.test(value);
}, "No white space please");

View file

@ -0,0 +1,22 @@
/**
* Return true if the field value matches the given format RegExp
*
* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
* @result true
*
* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
* @result false
*
* @name $.validator.methods.pattern
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("pattern", function(value, element, param) {
if (this.optional(element)) {
return true;
}
if (typeof param === "string") {
param = new RegExp("^(?:" + param + ")$");
}
return param.test(value);
}, "Invalid format.");

View file

@ -0,0 +1,6 @@
/**
* Dutch phone numbers have 10 digits (or 11 and start with +31).
*/
$.validator.addMethod("phoneNL", function(value, element) {
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
}, "Please specify a valid phone number.");

View file

@ -0,0 +1,13 @@
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
$.validator.addMethod("phoneUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
}, "Please specify a valid phone number");

View file

@ -0,0 +1,21 @@
/**
* matches US phone number format
*
* where the area code may not start with 1 and the prefix may not start with 1
* allows '-' or ' ' as a separator and allows parens around area code
* some people may want to put a '1' in front of their number
*
* 1(212)-999-2345 or
* 212 999 2344 or
* 212-999-0983
*
* but not
* 111-123-5434
* and not
* 212 123 4567
*/
$.validator.addMethod("phoneUS", function(phone_number, element) {
phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/);
}, "Please specify a valid phone number");

View file

@ -0,0 +1,14 @@
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
* Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
* Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
* A number of very detailed GB telephone number RegEx patterns can also be found at:
* http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
*/
//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
$.validator.addMethod("phonesUK", function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/);
}, "Please specify a valid uk phone number");

View file

@ -0,0 +1,16 @@
/**
* Matches a valid Canadian Postal Code
*
* @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element )
* @result true
*
* @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element )
* @result false
*
* @name jQuery.validator.methods.postalCodeCA
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod( "postalCodeCA", function( value, element ) {
return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value );
}, "Please specify a valid postal code" );

View file

@ -0,0 +1,11 @@
/*
* Valida CEPs do brasileiros:
*
* Formatos aceitos:
* 99999-999
* 99.999-999
* 99999999
*/
$.validator.addMethod("postalcodeBR", function(cep_value, element) {
return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value );
}, "Informe um CEP válido.");

View file

@ -0,0 +1,4 @@
/* Matches Italian postcode (CAP) */
$.validator.addMethod("postalcodeIT", function(value, element) {
return this.optional(element) || /^\d{5}$/.test(value);
}, "Please specify a valid postal code");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("postalcodeNL", function(value, element) {
return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
}, "Please specify a valid postal code");

View file

@ -0,0 +1,4 @@
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
$.validator.addMethod("postcodeUK", function(value, element) {
return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
}, "Please specify a valid UK postcode");

View file

@ -0,0 +1,37 @@
/*
* Lets you say "at least X inputs that match selector Y must be filled."
*
* The end result is that neither of these inputs:
*
* <input class="productinfo" name="partnumber">
* <input class="productinfo" name="description">
*
* ...will validate unless at least one of them is filled.
*
* partnumber: {require_from_group: [1,".productinfo"]},
* description: {require_from_group: [1,".productinfo"]}
*
* options[0]: number of fields that must be filled in the group
* options[1]: CSS selector that defines the group of conditionally required fields
*/
$.validator.addMethod("require_from_group", function(value, element, options) {
var $fields = $(options[1], element.form),
$fieldsFirst = $fields.eq(0),
validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this),
isValid = $fields.filter(function() {
return validator.elementValue(this);
}).length >= options[0];
// Store the cloned validator for future validation
$fieldsFirst.data("valid_req_grp", validator);
// If element isn't being validated, run each require_from_group field's validation rules
if (!$(element).data("being_validated")) {
$fields.data("being_validated", true);
$fields.each(function() {
validator.element(this);
});
$fields.data("being_validated", false);
}
return isValid;
}, $.validator.format("Please fill at least {0} of these fields."));

View file

@ -0,0 +1,43 @@
/*
* Lets you say "either at least X inputs that match selector Y must be filled,
* OR they must all be skipped (left blank)."
*
* The end result, is that none of these inputs:
*
* <input class="productinfo" name="partnumber">
* <input class="productinfo" name="description">
* <input class="productinfo" name="color">
*
* ...will validate unless either at least two of them are filled,
* OR none of them are.
*
* partnumber: {skip_or_fill_minimum: [2,".productinfo"]},
* description: {skip_or_fill_minimum: [2,".productinfo"]},
* color: {skip_or_fill_minimum: [2,".productinfo"]}
*
* options[0]: number of fields that must be filled in the group
* options[1]: CSS selector that defines the group of conditionally required fields
*
*/
$.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
var $fields = $(options[1], element.form),
$fieldsFirst = $fields.eq(0),
validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this),
numberFilled = $fields.filter(function() {
return validator.elementValue(this);
}).length,
isValid = numberFilled === 0 || numberFilled >= options[0];
// Store the cloned validator for future validation
$fieldsFirst.data("valid_skip", validator);
// If element isn't being validated, run each skip_or_fill_minimum field's validation rules
if (!$(element).data("being_validated")) {
$fields.data("being_validated", true);
$fields.each(function() {
validator.element(this);
});
$fields.data("being_validated", false);
}
return isValid;
}, $.validator.format("Please either skip these fields or fill at least {0} of them."));

View file

@ -0,0 +1,58 @@
/* Validates US States and/or Territories by @jdforsythe
* Can be case insensitive or require capitalization - default is case insensitive
* Can include US Territories or not - default does not
* Can include US Military postal abbreviations (AA, AE, AP) - default does not
*
* Note: "States" always includes DC (District of Colombia)
*
* Usage examples:
*
* This is the default - case insensitive, no territories, no military zones
* stateInput: {
* caseSensitive: false,
* includeTerritories: false,
* includeMilitary: false
* }
*
* Only allow capital letters, no territories, no military zones
* stateInput: {
* caseSensitive: false
* }
*
* Case insensitive, include territories but not military zones
* stateInput: {
* includeTerritories: true
* }
*
* Only allow capital letters, include territories and military zones
* stateInput: {
* caseSensitive: true,
* includeTerritories: true,
* includeMilitary: true
* }
*
*
*
*/
jQuery.validator.addMethod("stateUS", function(value, element, options) {
var isDefault = typeof options === "undefined",
caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive,
includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories,
includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary,
regex;
if (!includeTerritories && !includeMilitary) {
regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
} else if (includeTerritories && includeMilitary) {
regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
} else if (includeTerritories) {
regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
} else {
regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
}
regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i");
return this.optional(element) || regex.test(value);
},
"Please specify a valid state");

View file

@ -0,0 +1,4 @@
// TODO check if value starts with <, otherwise don't try stripping anything
$.validator.addMethod("strippedminlength", function(value, element, param) {
return $(value).text().length >= param;
}, $.validator.format("Please enter at least {0} characters"));

View file

@ -0,0 +1,3 @@
$.validator.addMethod("time", function(value, element) {
return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(value);
}, "Please enter a valid time, between 00:00 and 23:59");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("time12h", function(value, element) {
return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
}, "Please enter a valid time in 12-hour am/pm format");

View file

@ -0,0 +1,4 @@
// same as url, but TLD is optional
$.validator.addMethod("url2", function(value, element) {
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
}, $.validator.messages.url);

View file

@ -0,0 +1,54 @@
/**
* Return true, if the value is a valid vehicle identification number (VIN).
*
* Works with all kind of text inputs.
*
* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
* @desc Declares a required input element whose value must be a valid vehicle identification number.
*
* @name $.validator.methods.vinUS
* @type Boolean
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod("vinUS", function(v) {
if (v.length !== 17) {
return false;
}
var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
rs = 0,
i, n, d, f, cd, cdv;
for (i = 0; i < 17; i++) {
f = FL[i];
d = v.slice(i, i + 1);
if (i === 8) {
cdv = d;
}
if (!isNaN(d)) {
d *= f;
} else {
for (n = 0; n < LL.length; n++) {
if (d.toUpperCase() === LL[n]) {
d = VL[n];
d *= f;
if (isNaN(cdv) && n === 8) {
cdv = LL[n];
}
break;
}
}
}
rs += d;
}
cd = rs % 11;
if (cd === 10) {
cd = "X";
}
if (cd === cdv) {
return true;
}
return false;
}, "The specified vehicle identification number (VIN) is invalid.");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("zipcodeUS", function(value, element) {
return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value);
}, "The specified US ZIP Code is invalid");

View file

@ -0,0 +1,3 @@
$.validator.addMethod("ziprange", function(value, element) {
return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx");

View file

@ -0,0 +1,33 @@
// ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
var pendingRequests = {},
ajax;
// Use a prefilter if available (1.5+)
if ( $.ajaxPrefilter ) {
$.ajaxPrefilter(function( settings, _, xhr ) {
var port = settings.port;
if ( settings.mode === "abort" ) {
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
pendingRequests[port] = xhr;
}
});
} else {
// Proxy ajax
ajax = $.ajax;
$.ajax = function( settings ) {
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
if ( mode === "abort" ) {
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
pendingRequests[port] = ajax.apply(this, arguments);
return pendingRequests[port];
}
return ajax.apply(this, arguments);
};
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
$.extend($.fn, {
validateDelegate: function( delegate, type, handler ) {
return this.bind(type, function( event ) {
var target = $(event.target);
if ( target.is(delegate) ) {
return handler.apply(target, arguments);
}
});
}
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: AR (Arabic; العربية)
*/
$.extend($.validator.messages, {
required: "هذا الحقل إلزامي",
remote: "يرجى تصحيح هذا الحقل للمتابعة",
email: "رجاء إدخال عنوان بريد إلكتروني صحيح",
url: "رجاء إدخال عنوان موقع إلكتروني صحيح",
date: "رجاء إدخال تاريخ صحيح",
dateISO: "رجاء إدخال تاريخ صحيح (ISO)",
number: "رجاء إدخال عدد بطريقة صحيحة",
digits: "رجاء إدخال أرقام فقط",
creditcard: "رجاء إدخال رقم بطاقة ائتمان صحيح",
equalTo: "رجاء إدخال نفس القيمة",
extension: "رجاء إدخال ملف بامتداد موافق عليه",
maxlength: $.validator.format("الحد الأقصى لعدد الحروف هو {0}"),
minlength: $.validator.format("الحد الأدنى لعدد الحروف هو {0}"),
rangelength: $.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"),
range: $.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"),
max: $.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"),
min: $.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: BG (Bulgarian; български език)
*/
$.extend($.validator.messages, {
required: "Полето е задължително.",
remote: "Моля, въведете правилната стойност.",
email: "Моля, въведете валиден email.",
url: "Моля, въведете валидно URL.",
date: "Моля, въведете валидна дата.",
dateISO: "Моля, въведете валидна дата (ISO).",
number: "Моля, въведете валиден номер.",
digits: "Моля, въведете само цифри.",
creditcard: "Моля, въведете валиден номер на кредитна карта.",
equalTo: "Моля, въведете същата стойност отново.",
extension: "Моля, въведете стойност с валидно разширение.",
maxlength: $.validator.format("Моля, въведете повече от {0} символа."),
minlength: $.validator.format("Моля, въведете поне {0} символа."),
rangelength: $.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."),
range: $.validator.format("Моля, въведете стойност между {0} и {1}."),
max: $.validator.format("Моля, въведете стойност по-малка или равна на {0}."),
min: $.validator.format("Моля, въведете стойност по-голяма или равна на {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: CA (Catalan; català)
*/
$.extend($.validator.messages, {
required: "Aquest camp és obligatori.",
remote: "Si us plau, omple aquest camp.",
email: "Si us plau, escriu una adreça de correu-e vàlida",
url: "Si us plau, escriu una URL vàlida.",
date: "Si us plau, escriu una data vàlida.",
dateISO: "Si us plau, escriu una data (ISO) vàlida.",
number: "Si us plau, escriu un número enter vàlid.",
digits: "Si us plau, escriu només dígits.",
creditcard: "Si us plau, escriu un número de tarjeta vàlid.",
equalTo: "Si us plau, escriu el maateix valor de nou.",
extension: "Si us plau, escriu un valor amb una extensió acceptada.",
maxlength: $.validator.format("Si us plau, no escriguis més de {0} caracters."),
minlength: $.validator.format("Si us plau, no escriguis menys de {0} caracters."),
rangelength: $.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."),
range: $.validator.format("Si us plau, escriu un valor entre {0} i {1}."),
max: $.validator.format("Si us plau, escriu un valor menor o igual a {0}."),
min: $.validator.format("Si us plau, escriu un valor major o igual a {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: CS (Czech; čeština, český jazyk)
*/
$.extend($.validator.messages, {
required: "Tento údaj je povinný.",
remote: "Prosím, opravte tento údaj.",
email: "Prosím, zadejte platný e-mail.",
url: "Prosím, zadejte platné URL.",
date: "Prosím, zadejte platné datum.",
dateISO: "Prosím, zadejte platné datum (ISO).",
number: "Prosím, zadejte číslo.",
digits: "Prosím, zadávejte pouze číslice.",
creditcard: "Prosím, zadejte číslo kreditní karty.",
equalTo: "Prosím, zadejte znovu stejnou hodnotu.",
extension: "Prosím, zadejte soubor se správnou příponou.",
maxlength: $.validator.format("Prosím, zadejte nejvíce {0} znaků."),
minlength: $.validator.format("Prosím, zadejte nejméně {0} znaků."),
rangelength: $.validator.format("Prosím, zadejte od {0} do {1} znaků."),
range: $.validator.format("Prosím, zadejte hodnotu od {0} do {1}."),
max: $.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."),
min: $.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.")
});

View file

@ -0,0 +1,20 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: DA (Danish; dansk)
*/
$.extend($.validator.messages, {
required: "Dette felt er påkrævet.",
maxlength: $.validator.format("Indtast højst {0} tegn."),
minlength: $.validator.format("Indtast mindst {0} tegn."),
rangelength: $.validator.format("Indtast mindst {0} og højst {1} tegn."),
email: "Indtast en gyldig email-adresse.",
url: "Indtast en gyldig URL.",
date: "Indtast en gyldig dato.",
number: "Indtast et tal.",
digits: "Indtast kun cifre.",
equalTo: "Indtast den samme værdi igen.",
range: $.validator.format("Angiv en værdi mellem {0} og {1}."),
max: $.validator.format("Angiv en værdi der højst er {0}."),
min: $.validator.format("Angiv en værdi der mindst er {0}."),
creditcard: "Indtast et gyldigt kreditkortnummer."
});

View file

@ -0,0 +1,20 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: DE (German, Deutsch)
*/
$.extend($.validator.messages, {
required: "Dieses Feld ist ein Pflichtfeld.",
maxlength: $.validator.format("Geben Sie bitte maximal {0} Zeichen ein."),
minlength: $.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."),
rangelength: $.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."),
email: "Geben Sie bitte eine gültige E-Mail Adresse ein.",
url: "Geben Sie bitte eine gültige URL ein.",
date: "Bitte geben Sie ein gültiges Datum ein.",
number: "Geben Sie bitte eine Nummer ein.",
digits: "Geben Sie bitte nur Ziffern ein.",
equalTo: "Bitte denselben Wert wiederholen.",
range: $.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."),
max: $.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."),
min: $.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."),
creditcard: "Geben Sie bitte eine gültige Kreditkarten-Nummer ein."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: EL (Greek; ελληνικά)
*/
$.extend($.validator.messages, {
required: "Αυτό το πεδίο είναι υποχρεωτικό.",
remote: "Παρακαλώ διορθώστε αυτό το πεδίο.",
email: "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.",
url: "Παρακαλώ εισάγετε ένα έγκυρο URL.",
date: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.",
dateISO: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).",
number: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό.",
digits: "Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.",
creditcard: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.",
equalTo: "Παρακαλώ εισάγετε την ίδια τιμή ξανά.",
extension: "Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.",
maxlength: $.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."),
minlength: $.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."),
rangelength: $.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."),
range: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."),
max: $.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."),
min: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.")
});

View file

@ -0,0 +1,26 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ES (Spanish; Español)
*/
$.extend($.validator.messages, {
required: "Este campo es obligatorio.",
remote: "Por favor, rellena este campo.",
email: "Por favor, escribe una dirección de correo válida.",
url: "Por favor, escribe una URL válida.",
date: "Por favor, escribe una fecha válida.",
dateISO: "Por favor, escribe una fecha (ISO) válida.",
number: "Por favor, escribe un número válido.",
digits: "Por favor, escribe sólo dígitos.",
creditcard: "Por favor, escribe un número de tarjeta válido.",
equalTo: "Por favor, escribe el mismo valor de nuevo.",
extension: "Por favor, escribe un valor con una extensión aceptada.",
maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."),
minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."),
rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."),
range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."),
max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."),
min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}."),
nifES: "Por favor, escribe un NIF válido.",
nieES: "Por favor, escribe un NIE válido.",
cifES: "Por favor, escribe un CIF válido."
});

View file

@ -0,0 +1,27 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ES (Spanish; Español)
* Region: AR (Argentina)
*/
$.extend($.validator.messages, {
required: "Este campo es obligatorio.",
remote: "Por favor, completá este campo.",
email: "Por favor, escribí una dirección de correo válida.",
url: "Por favor, escribí una URL válida.",
date: "Por favor, escribí una fecha válida.",
dateISO: "Por favor, escribí una fecha (ISO) válida.",
number: "Por favor, escribí un número entero válido.",
digits: "Por favor, escribí sólo dígitos.",
creditcard: "Por favor, escribí un número de tarjeta válido.",
equalTo: "Por favor, escribí el mismo valor de nuevo.",
extension: "Por favor, escribí un valor con una extensión aceptada.",
maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."),
minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."),
rangelength: $.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."),
range: $.validator.format("Por favor, escribí un valor entre {0} y {1}."),
max: $.validator.format("Por favor, escribí un valor menor o igual a {0}."),
min: $.validator.format("Por favor, escribí un valor mayor o igual a {0}."),
nifES: "Por favor, escribí un NIF válido.",
nieES: "Por favor, escribí un NIE válido.",
cifES: "Por favor, escribí un CIF válido."
});

View file

@ -0,0 +1,21 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ET (Estonian; eesti, eesti keel)
*/
$.extend($.validator.messages, {
required: "See väli peab olema täidetud.",
maxlength: $.validator.format("Palun sisestage vähem kui {0} tähemärki."),
minlength: $.validator.format("Palun sisestage vähemalt {0} tähemärki."),
rangelength: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."),
email: "Palun sisestage korrektne e-maili aadress.",
url: "Palun sisestage korrektne URL.",
date: "Palun sisestage korrektne kuupäev.",
dateISO: "Palun sisestage korrektne kuupäev (YYYY-MM-DD).",
number: "Palun sisestage korrektne number.",
digits: "Palun sisestage ainult numbreid.",
equalTo: "Palun sisestage sama väärtus uuesti.",
range: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."),
max: $.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."),
min: $.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."),
creditcard: "Palun sisestage korrektne krediitkaardi number."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: EU (Basque; euskara, euskera)
*/
$.extend($.validator.messages, {
required: "Eremu hau beharrezkoa da.",
remote: "Mesedez, bete eremu hau.",
email: "Mesedez, idatzi baliozko posta helbide bat.",
url: "Mesedez, idatzi baliozko URL bat.",
date: "Mesedez, idatzi baliozko data bat.",
dateISO: "Mesedez, idatzi baliozko (ISO) data bat.",
number: "Mesedez, idatzi baliozko zenbaki oso bat.",
digits: "Mesedez, idatzi digituak soilik.",
creditcard: "Mesedez, idatzi baliozko txartel zenbaki bat.",
equalTo: "Mesedez, idatzi berdina berriro ere.",
extension: "Mesedez, idatzi onartutako luzapena duen balio bat.",
maxlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."),
minlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."),
rangelength: $.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."),
range: $.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."),
max: $.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."),
min: $.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.")
});

View file

@ -0,0 +1,26 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: FA (Persian; فارسی)
*/
$.extend($.validator.messages, {
required: "تکمیل این فیلد اجباری است.",
remote: "لطفا این فیلد را تصحیح کنید.",
email: ".لطفا یک ایمیل صحیح وارد کنید",
url: "لطفا آدرس صحیح وارد کنید.",
date: "لطفا یک تاریخ صحیح وارد کنید",
dateFA: "لطفا یک تاریخ صحیح وارد کنید",
dateISO: "لطفا تاریخ صحیح وارد کنید (ISO).",
number: "لطفا عدد صحیح وارد کنید.",
digits: "لطفا تنها رقم وارد کنید",
creditcard: "لطفا کریدیت کارت صحیح وارد کنید.",
equalTo: "لطفا مقدار برابری وارد کنید",
extension: "لطفا مقداری وارد کنید که ",
maxlength: $.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."),
minlength: $.validator.format("لطفا کمتر از {0} حرف وارد نکنید."),
rangelength: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),
range: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),
max: $.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."),
min: $.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."),
minWords: $.validator.format("لطفا حداقل {0} کلمه وارد کنید."),
maxWords: $.validator.format("لطفا حداکثر {0} کلمه وارد کنید.")
});

View file

@ -0,0 +1,21 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: FI (Finnish; suomi, suomen kieli)
*/
$.extend($.validator.messages, {
required: "T&auml;m&auml; kentt&auml; on pakollinen.",
email: "Sy&ouml;t&auml; oikea s&auml;hk&ouml;postiosoite.",
url: "Sy&ouml;t&auml; oikea URL osoite.",
date: "Sy&ouml;t&auml; oike p&auml;iv&auml;m&auml;&auml;r&auml;.",
dateISO: "Sy&ouml;t&auml; oike p&auml;iv&auml;m&auml;&auml;r&auml; (VVVV-MM-DD).",
number: "Sy&ouml;t&auml; numero.",
creditcard: "Sy&ouml;t&auml; voimassa oleva luottokorttinumero.",
digits: "Sy&ouml;t&auml; pelk&auml;st&auml;&auml;n numeroita.",
equalTo: "Sy&ouml;t&auml; sama arvo uudestaan.",
maxlength: $.validator.format("Voit sy&ouml;tt&auml;&auml; enint&auml;&auml;n {0} merkki&auml;."),
minlength: $.validator.format("V&auml;hint&auml;&auml;n {0} merkki&auml;."),
rangelength: $.validator.format("Sy&ouml;t&auml; v&auml;hint&auml;&auml;n {0} ja enint&auml;&auml;n {1} merkki&auml;."),
range: $.validator.format("Sy&ouml;t&auml; arvo {0} ja {1} v&auml;lilt&auml;."),
max: $.validator.format("Sy&ouml;t&auml; arvo joka on pienempi tai yht&auml; suuri kuin {0}."),
min: $.validator.format("Sy&ouml;t&auml; arvo joka on yht&auml; suuri tai suurempi kuin {0}.")
});

View file

@ -0,0 +1,49 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: FR (French; français)
*/
$.extend($.validator.messages, {
required: "Ce champ est obligatoire.",
remote: "Veuillez corriger ce champ.",
email: "Veuillez fournir une adresse électronique valide.",
url: "Veuillez fournir une adresse URL valide.",
date: "Veuillez fournir une date valide.",
dateISO: "Veuillez fournir une date valide (ISO).",
number: "Veuillez fournir un numéro valide.",
digits: "Veuillez fournir seulement des chiffres.",
creditcard: "Veuillez fournir un numéro de carte de crédit valide.",
equalTo: "Veuillez fournir encore la même valeur.",
extension: "Veuillez fournir une valeur avec une extension valide.",
maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."),
minlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),
range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."),
max: $.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."),
min: $.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."),
maxWords: $.validator.format("Veuillez fournir au plus {0} mots."),
minWords: $.validator.format("Veuillez fournir au moins {0} mots."),
rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."),
letterswithbasicpunc: "Veuillez fournir seulement des lettres et des signes de ponctuation.",
alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages.",
lettersonly: "Veuillez fournir seulement des lettres.",
nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.",
ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.",
integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.",
vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).",
dateITA: "Veuillez fournir une date valide.",
time: "Veuillez fournir une heure valide entre 00:00 et 23:59.",
phoneUS: "Veuillez fournir un numéro de téléphone valide.",
phoneUK: "Veuillez fournir un numéro de téléphone valide.",
mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.",
strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
email2: "Veuillez fournir une adresse électronique valide.",
url2: "Veuillez fournir une adresse URL valide.",
creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.",
ipv4: "Veuillez fournir une adresse IP v4 valide.",
ipv6: "Veuillez fournir une adresse IP v6 valide.",
require_from_group: "Veuillez fournir au moins {0} de ces champs.",
nifES: "Veuillez fournir un numéro NIF valide.",
nieES: "Veuillez fournir un numéro NIE valide.",
cifES: "Veuillez fournir un numéro CIF valide.",
postalCodeCA: "Veuillez fournir un code postal valide."
});

View file

@ -0,0 +1,28 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: GL (Galician; Galego)
*/
(function($) {
$.extend($.validator.messages, {
required: "Este campo é obrigatorio.",
remote: "Por favor, cubre este campo.",
email: "Por favor, escribe unha dirección de correo válida.",
url: "Por favor, escribe unha URL válida.",
date: "Por favor, escribe unha data válida.",
dateISO: "Por favor, escribe unha data (ISO) válida.",
number: "Por favor, escribe un número válido.",
digits: "Por favor, escribe só díxitos.",
creditcard: "Por favor, escribe un número de tarxeta válido.",
equalTo: "Por favor, escribe o mesmo valor de novo.",
extension: "Por favor, escribe un valor cunha extensión aceptada.",
maxlength: $.validator.format("Por favor, non escribas máis de {0} caracteres."),
minlength: $.validator.format("Por favor, non escribas menos de {0} caracteres."),
rangelength: $.validator.format("Por favor, escribe un valor entre {0} e {1} caracteres."),
range: $.validator.format("Por favor, escribe un valor entre {0} e {1}."),
max: $.validator.format("Por favor, escribe un valor menor ou igual a {0}."),
min: $.validator.format("Por favor, escribe un valor maior ou igual a {0}."),
nifES: "Por favor, escribe un NIF válido.",
nieES: "Por favor, escribe un NIE válido.",
cifES: "Por favor, escribe un CIF válido."
});
}(jQuery));

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: HE (Hebrew; עברית)
*/
$.extend($.validator.messages, {
required: "השדה הזה הינו שדה חובה",
remote: "נא לתקן שדה זה",
email: "נא למלא כתובת דוא\"ל חוקית",
url: "נא למלא כתובת אינטרנט חוקית",
date: "נא למלא תאריך חוקי",
dateISO: "נא למלא תאריך חוקי (ISO)",
number: "נא למלא מספר",
digits: "נא למלא רק מספרים",
creditcard: "נא למלא מספר כרטיס אשראי חוקי",
equalTo: "נא למלא את אותו ערך שוב",
extension: "נא למלא ערך עם סיומת חוקית",
maxlength: $.validator.format(".נא לא למלא יותר מ- {0} תווים"),
minlength: $.validator.format("נא למלא לפחות {0} תווים"),
rangelength: $.validator.format("נא למלא ערך בין {0} ל- {1} תווים"),
range: $.validator.format("נא למלא ערך בין {0} ל- {1}"),
max: $.validator.format("נא למלא ערך קטן או שווה ל- {0}"),
min: $.validator.format("נא למלא ערך גדול או שווה ל- {0}")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: HR (Croatia; hrvatski jezik)
*/
$.extend($.validator.messages, {
required: "Ovo polje je obavezno.",
remote: "Ovo polje treba popraviti.",
email: "Unesite ispravnu e-mail adresu.",
url: "Unesite ispravan URL.",
date: "Unesite ispravan datum.",
dateISO: "Unesite ispravan datum (ISO).",
number: "Unesite ispravan broj.",
digits: "Unesite samo brojeve.",
creditcard: "Unesite ispravan broj kreditne kartice.",
equalTo: "Unesite ponovo istu vrijednost.",
extension: "Unesite vrijednost sa ispravnom ekstenzijom.",
maxlength: $.validator.format("Maksimalni broj znakova je {0} ."),
minlength: $.validator.format("Minimalni broj znakova je {0} ."),
rangelength: $.validator.format("Unesite vrijednost između {0} i {1} znakova."),
range: $.validator.format("Unesite vrijednost između {0} i {1}."),
max: $.validator.format("Unesite vrijednost manju ili jednaku {0}."),
min: $.validator.format("Unesite vrijednost veću ili jednaku {0}.")
});

View file

@ -0,0 +1,22 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: HU (Hungarian; Magyar)
*/
$.extend($.validator.messages, {
required: "Kötelező megadni.",
maxlength: $.validator.format("Legfeljebb {0} karakter hosszú legyen."),
minlength: $.validator.format("Legalább {0} karakter hosszú legyen."),
rangelength: $.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."),
email: "Érvényes e-mail címnek kell lennie.",
url: "Érvényes URL-nek kell lennie.",
date: "Dátumnak kell lennie.",
number: "Számnak kell lennie.",
digits: "Csak számjegyek lehetnek.",
equalTo: "Meg kell egyeznie a két értéknek.",
range: $.validator.format("{0} és {1} közé kell esnie."),
max: $.validator.format("Nem lehet nagyobb, mint {0}."),
min: $.validator.format("Nem lehet kisebb, mint {0}."),
creditcard: "Érvényes hitelkártyaszámnak kell lennie.",
remote: "Kérem javítsa ki ezt a mezőt.",
dateISO: "Kérem írjon be egy érvényes dátumot (ISO)."
});

View file

@ -0,0 +1,22 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ID (Indonesia; Indonesian)
*/
$.extend($.validator.messages, {
required: "Kolom ini diperlukan.",
remote: "Harap benarkan kolom ini.",
email: "Silakan masukkan format email yang benar.",
url: "Silakan masukkan format URL yang benar.",
date: "Silakan masukkan format tanggal yang benar.",
dateISO: "Silakan masukkan format tanggal(ISO) yang benar.",
number: "Silakan masukkan angka yang benar.",
digits: "Harap masukan angka saja.",
creditcard: "Harap masukkan format kartu kredit yang benar.",
equalTo: "Harap masukkan nilai yg sama dengan sebelumnya.",
maxlength: $.validator.format("Input dibatasi hanya {0} karakter."),
minlength: $.validator.format("Input tidak kurang dari {0} karakter."),
rangelength: $.validator.format("Panjang karakter yg diizinkan antara {0} dan {1} karakter."),
range: $.validator.format("Harap masukkan nilai antara {0} dan {1}."),
max: $.validator.format("Harap masukkan nilai lebih kecil atau sama dengan {0}."),
min: $.validator.format("Harap masukkan nilai lebih besar atau sama dengan {0}.")
});

View file

@ -0,0 +1,21 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: IS (Icelandic; íslenska)
*/
$.extend($.validator.messages, {
required: "Þessi reitur er nauðsynlegur.",
remote: "Lagaðu þennan reit.",
maxlength: $.validator.format("Sláðu inn mest {0} stafi."),
minlength: $.validator.format("Sláðu inn minnst {0} stafi."),
rangelength: $.validator.format("Sláðu inn minnst {0} og mest {1} stafi."),
email: "Sláðu inn gilt netfang.",
url: "Sláðu inn gilda vefslóð.",
date: "Sláðu inn gilda dagsetningu.",
number: "Sláðu inn tölu.",
digits: "Sláðu inn tölustafi eingöngu.",
equalTo: "Sláðu sama gildi inn aftur.",
range: $.validator.format("Sláðu inn gildi milli {0} og {1}."),
max: $.validator.format("Sláðu inn gildi sem er minna en eða jafnt og {0}."),
min: $.validator.format("Sláðu inn gildi sem er stærra en eða jafnt og {0}."),
creditcard: "Sláðu inn gilt greiðslukortanúmer."
});

View file

@ -0,0 +1,26 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: IT (Italian; Italiano)
*/
$.extend($.validator.messages, {
required: "Campo obbligatorio.",
remote: "Controlla questo campo.",
email: "Inserisci un indirizzo email valido.",
url: "Inserisci un indirizzo web valido.",
date: "Inserisci una data valida.",
dateISO: "Inserisci una data valida (ISO).",
number: "Inserisci un numero valido.",
digits: "Inserisci solo numeri.",
creditcard: "Inserisci un numero di carta di credito valido.",
equalTo: "Il valore non corrisponde.",
extension: "Inserisci un valore con un&apos;estensione valida.",
maxlength: $.validator.format("Non inserire pi&ugrave; di {0} caratteri."),
minlength: $.validator.format("Inserisci almeno {0} caratteri."),
rangelength: $.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri."),
range: $.validator.format("Inserisci un valore compreso tra {0} e {1}."),
max: $.validator.format("Inserisci un valore minore o uguale a {0}."),
min: $.validator.format("Inserisci un valore maggiore o uguale a {0}."),
nifES: "Inserisci un NIF valido.",
nieES: "Inserisci un NIE valido.",
cifES: "Inserisci un CIF valido."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: JA (Japanese; 日本語)
*/
$.extend($.validator.messages, {
required: "このフィールドは必須です。",
remote: "このフィールドを修正してください。",
email: "有効なEメールアドレスを入力してください。",
url: "有効なURLを入力してください。",
date: "有効な日付を入力してください。",
dateISO: "有効な日付ISOを入力してください。",
number: "有効な数字を入力してください。",
digits: "数字のみを入力してください。",
creditcard: "有効なクレジットカード番号を入力してください。",
equalTo: "同じ値をもう一度入力してください。",
extension: "有効な拡張子を含む値を入力してください。",
maxlength: $.validator.format("{0} 文字以内で入力してください。"),
minlength: $.validator.format("{0} 文字以上で入力してください。"),
rangelength: $.validator.format("{0} 文字から {1} 文字までの値を入力してください。"),
range: $.validator.format("{0} から {1} までの値を入力してください。"),
max: $.validator.format("{0} 以下の値を入力してください。"),
min: $.validator.format("{0} 以上の値を入力してください。")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: KA (Georgian; ქართული)
*/
$.extend($.validator.messages, {
required: "ამ ველის შევსება აუცილებელია.",
remote: "გთხოვთ მიუთითოთ სწორი მნიშვნელობა.",
email: "გთხოვთ მიუთითოთ ელ-ფოსტის კორექტული მისამართი.",
url: "გთხოვთ მიუთითოთ კორექტული URL.",
date: "გთხოვთ მიუთითოთ კორექტული თარიღი.",
dateISO: "გთხოვთ მიუთითოთ კორექტული თარიღი ISO ფორმატში.",
number: "გთხოვთ მიუთითოთ ციფრი.",
digits: "გთხოვთ მიუთითოთ მხოლოდ ციფრები.",
creditcard: "გთხოვთ მიუთითოთ საკრედიტო ბარათის კორექტული ნომერი.",
equalTo: "გთხოვთ მიუთითოთ ასეთივე მნიშვნელობა კიდევ ერთხელ.",
extension: "გთხოვთ აირჩიოთ ფაილი კორექტული გაფართოებით.",
maxlength: $.validator.format("დასაშვებია არაუმეტეს {0} სიმბოლო."),
minlength: $.validator.format("აუცილებელია შეიყვანოთ მინიმუმ {0} სიმბოლო."),
rangelength: $.validator.format("ტექსტში სიმბოლოების რაოდენობა უნდა იყოს {0}-დან {1}-მდე."),
range: $.validator.format("გთხოვთ შეიყვანოთ ციფრი {0}-დან {1}-მდე."),
max: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც ნაკლებია ან უდრის {0}-ს."),
min: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც მეტია ან უდრის {0}-ს.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: KK (Kazakh; қазақ тілі)
*/
$.extend($.validator.messages, {
required: "Бұл өрісті міндетті түрде толтырыңыз.",
remote: "Дұрыс мағына енгізуіңізді сұраймыз.",
email: "Нақты электронды поштаңызды енгізуіңізді сұраймыз.",
url: "Нақты URL-ды енгізуіңізді сұраймыз.",
date: "Нақты URL-ды енгізуіңізді сұраймыз.",
dateISO: "Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.",
number: "Күнді енгізуіңізді сұраймыз.",
digits: "Тек қана сандарды енгізуіңізді сұраймыз.",
creditcard: "Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.",
equalTo: "Осы мәнді қайта енгізуіңізді сұраймыз.",
extension: "Файлдың кеңейтуін дұрыс таңдаңыз.",
maxlength: $.validator.format("Ұзындығы {0} символдан көр болмасын."),
minlength: $.validator.format("Ұзындығы {0} символдан аз болмасын."),
rangelength: $.validator.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."),
range: $.validator.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."),
max: $.validator.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."),
min: $.validator.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: KO (Korean; 한국어)
*/
$.extend($.validator.messages, {
required: "필수 항목입니다.",
remote: "항목을 수정하세요.",
email: "유효하지 않은 E-Mail주소입니다.",
url: "유효하지 않은 URL입니다.",
date: "올바른 날짜를 입력하세요.",
dateISO: "올바른 날짜(ISO)를 입력하세요.",
number: "유효한 숫자가 아닙니다.",
digits: "숫자만 입력 가능합니다.",
creditcard: "신용카드 번호가 바르지 않습니다.",
equalTo: "같은 값을 다시 입력하세요.",
extension: "올바른 확장자가 아닙니다.",
maxlength: $.validator.format("{0}자를 넘을 수 없습니다. "),
minlength: $.validator.format("{0}자 이상 입력하세요."),
rangelength: $.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."),
range: $.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."),
max: $.validator.format("{0} 이하의 값을 입력하세요."),
min: $.validator.format("{0} 이상의 값을 입력하세요.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: LT (Lithuanian; lietuvių kalba)
*/
$.extend($.validator.messages, {
required: "Šis laukas yra privalomas.",
remote: "Prašau pataisyti šį lauką.",
email: "Prašau įvesti teisingą elektroninio pašto adresą.",
url: "Prašau įvesti teisingą URL.",
date: "Prašau įvesti teisingą datą.",
dateISO: "Prašau įvesti teisingą datą (ISO).",
number: "Prašau įvesti teisingą skaičių.",
digits: "Prašau naudoti tik skaitmenis.",
creditcard: "Prašau įvesti teisingą kreditinės kortelės numerį.",
equalTo: "Prašau įvestį tą pačią reikšmę dar kartą.",
extension: "Prašau įvesti reikšmę su teisingu plėtiniu.",
maxlength: $.validator.format("Prašau įvesti ne daugiau kaip {0} simbolių."),
minlength: $.validator.format("Prašau įvesti bent {0} simbolius."),
rangelength: $.validator.format("Prašau įvesti reikšmes, kurių ilgis nuo {0} iki {1} simbolių."),
range: $.validator.format("Prašau įvesti reikšmę intervale nuo {0} iki {1}."),
max: $.validator.format("Prašau įvesti reikšmę mažesnę arba lygią {0}."),
min: $.validator.format("Prašau įvesti reikšmę didesnę arba lygią {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: LV (Latvian; latviešu valoda)
*/
$.extend($.validator.messages, {
required: "Šis lauks ir obligāts.",
remote: "Lūdzu, pārbaudiet šo lauku.",
email: "Lūdzu, ievadiet derīgu e-pasta adresi.",
url: "Lūdzu, ievadiet derīgu URL adresi.",
date: "Lūdzu, ievadiet derīgu datumu.",
dateISO: "Lūdzu, ievadiet derīgu datumu (ISO).",
number: "Lūdzu, ievadiet derīgu numuru.",
digits: "Lūdzu, ievadiet tikai ciparus.",
creditcard: "Lūdzu, ievadiet derīgu kredītkartes numuru.",
equalTo: "Lūdzu, ievadiet to pašu vēlreiz.",
extension: "Lūdzu, ievadiet vērtību ar derīgu paplašinājumu.",
maxlength: $.validator.format("Lūdzu, ievadiet ne vairāk kā {0} rakstzīmes."),
minlength: $.validator.format("Lūdzu, ievadiet vismaz {0} rakstzīmes."),
rangelength: $.validator.format("Lūdzu ievadiet {0} līdz {1} rakstzīmes."),
range: $.validator.format("Lūdzu, ievadiet skaitli no {0} līdz {1}."),
max: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir mazāks vai vienāds ar {0}."),
min: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir lielāks vai vienāds ar {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: MY (Malay; Melayu)
*/
$.extend($.validator.messages, {
required: "Medan ini diperlukan.",
remote: "Sila betulkan medan ini.",
email: "Sila masukkan alamat emel yang betul.",
url: "Sila masukkan URL yang betul.",
date: "Sila masukkan tarikh yang betul.",
dateISO: "Sila masukkan tarikh(ISO) yang betul.",
number: "Sila masukkan nombor yang betul.",
digits: "Sila masukkan nilai digit sahaja.",
creditcard: "Sila masukkan nombor kredit kad yang betul.",
equalTo: "Sila masukkan nilai yang sama semula.",
extension: "Sila masukkan nilai yang telah diterima.",
maxlength: $.validator.format("Sila masukkan nilai tidak lebih dari {0} aksara."),
minlength: $.validator.format("Sila masukkan nilai sekurang-kurangnya {0} aksara."),
rangelength: $.validator.format("Sila masukkan panjang nilai antara {0} dan {1} aksara."),
range: $.validator.format("Sila masukkan nilai antara {0} dan {1} aksara."),
max: $.validator.format("Sila masukkan nilai yang kurang atau sama dengan {0}."),
min: $.validator.format("Sila masukkan nilai yang lebih atau sama dengan {0}.")
});

View file

@ -0,0 +1,33 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: NL (Dutch; Nederlands, Vlaams)
*/
$.extend($.validator.messages, {
required: "Dit is een verplicht veld.",
remote: "Controleer dit veld.",
email: "Vul hier een geldig e-mailadres in.",
url: "Vul hier een geldige URL in.",
date: "Vul hier een geldige datum in.",
dateISO: "Vul hier een geldige datum in (ISO-formaat).",
number: "Vul hier een geldig getal in.",
digits: "Vul hier alleen getallen in.",
creditcard: "Vul hier een geldig creditcardnummer in.",
equalTo: "Vul hier dezelfde waarde in.",
extension: "Vul hier een waarde in met een geldige extensie.",
maxlength: $.validator.format("Vul hier maximaal {0} tekens in."),
minlength: $.validator.format("Vul hier minimaal {0} tekens in."),
rangelength: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."),
range: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."),
max: $.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."),
min: $.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}."),
// for validations in additional-methods.js
iban: "Vul hier een geldig IBAN in.",
dateNL: "Vul hier een geldige datum in.",
phoneNL: "Vul hier een geldig Nederlands telefoonnummer in.",
mobileNL: "Vul hier een geldig Nederlands mobiel telefoonnummer in.",
postalcodeNL: "Vul hier een geldige postcode in.",
bankaccountNL: "Vul hier een geldig bankrekeningnummer in.",
giroaccountNL: "Vul hier een geldig gironummer in.",
bankorgiroaccountNL: "Vul hier een geldig bank- of gironummer in."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: NO (Norwegian; Norsk)
*/
$.extend($.validator.messages, {
required: "Dette feltet er obligatorisk.",
maxlength: $.validator.format("Maksimalt {0} tegn."),
minlength: $.validator.format("Minimum {0} tegn."),
rangelength: $.validator.format("Angi minimum {0} og maksimum {1} tegn."),
email: "Oppgi en gyldig epostadresse.",
url: "Angi en gyldig URL.",
date: "Angi en gyldig dato.",
dateISO: "Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).",
dateSE: "Angi en gyldig dato.",
number: "Angi et gyldig nummer.",
numberSE: "Angi et gyldig nummer.",
digits: "Skriv kun tall.",
equalTo: "Skriv samme verdi igjen.",
range: $.validator.format("Angi en verdi mellom {0} og {1}."),
max: $.validator.format("Angi en verdi som er mindre eller lik {0}."),
min: $.validator.format("Angi en verdi som er st&oslash;rre eller lik {0}."),
creditcard: "Angi et gyldig kredittkortnummer."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PL (Polish; język polski, polszczyzna)
*/
$.extend($.validator.messages, {
required: "To pole jest wymagane.",
remote: "Proszę o wypełnienie tego pola.",
email: "Proszę o podanie prawidłowego adresu email.",
url: "Proszę o podanie prawidłowego URL.",
date: "Proszę o podanie prawidłowej daty.",
dateISO: "Proszę o podanie prawidłowej daty (ISO).",
number: "Proszę o podanie prawidłowej liczby.",
digits: "Proszę o podanie samych cyfr.",
creditcard: "Proszę o podanie prawidłowej karty kredytowej.",
equalTo: "Proszę o podanie tej samej wartości ponownie.",
extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.",
maxlength: $.validator.format("Proszę o podanie nie więcej niż {0} znaków."),
minlength: $.validator.format("Proszę o podanie przynajmniej {0} znaków."),
rangelength: $.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."),
range: $.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."),
max: $.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."),
min: $.validator.format("Proszę o podanie wartości większej bądź równej {0}.")
});

View file

@ -0,0 +1,28 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil)
*/
$.extend($.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o de email v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
extension: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
maxlength: $.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
minlength: $.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
rangelength: $.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
range: $.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
max: $.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
min: $.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}."),
nifES: "Por favor, forne&ccedil;a um NIF v&aacute;lido.",
nieES: "Por favor, forne&ccedil;a um NIE v&aacute;lido.",
cifEE: "Por favor, forne&ccedil;a um CIF v&aacute;lido.",
postalcodeBR: "Por favor, forne&ccedil;a um CEP v&aacute;lido."
});

View file

@ -0,0 +1,27 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT (Portuguese; português)
* Region: PT (Portugal)
*/
$.extend($.validator.messages, {
required: "Campo de preenchimento obrigat&oacute;rio.",
remote: "Por favor, corrija este campo.",
email: "Por favor, introduza um endere&ccedil;o eletr&oacute;nico v&aacute;lido.",
url: "Por favor, introduza um URL v&aacute;lido.",
date: "Por favor, introduza uma data v&aacute;lida.",
dateISO: "Por favor, introduza uma data v&aacute;lida (ISO).",
number: "Por favor, introduza um n&uacute;mero v&aacute;lido.",
digits: "Por favor, introduza apenas d&iacute;gitos.",
creditcard: "Por favor, introduza um n&uacute;mero de cart&atilde;o de cr&eacute;dito v&aacute;lido.",
equalTo: "Por favor, introduza de novo o mesmo valor.",
extension: "Por favor, introduza um ficheiro com uma extens&atilde;o v&aacute;lida.",
maxlength: $.validator.format("Por favor, n&atilde;o introduza mais do que {0} caracteres."),
minlength: $.validator.format("Por favor, introduza pelo menos {0} caracteres."),
rangelength: $.validator.format("Por favor, introduza entre {0} e {1} caracteres."),
range: $.validator.format("Por favor, introduza um valor entre {0} e {1}."),
max: $.validator.format("Por favor, introduza um valor menor ou igual a {0}."),
min: $.validator.format("Por favor, introduza um valor maior ou igual a {0}."),
nifES: "Por favor, introduza um NIF v&aacute;lido.",
nieES: "Por favor, introduza um NIE v&aacute;lido.",
cifES: "Por favor, introduza um CIF v&aacute;lido."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: RO (Romanian, limba română)
*/
$.extend($.validator.messages, {
required: "Acest câmp este obligatoriu.",
remote: "Te rugăm să completezi acest câmp.",
email: "Te rugăm să introduci o adresă de email validă",
url: "Te rugăm sa introduci o adresă URL validă.",
date: "Te rugăm să introduci o dată corectă.",
dateISO: "Te rugăm să introduci o dată (ISO) corectă.",
number: "Te rugăm să introduci un număr întreg valid.",
digits: "Te rugăm să introduci doar cifre.",
creditcard: "Te rugăm să introduci un numar de carte de credit valid.",
equalTo: "Te rugăm să reintroduci valoarea.",
extension: "Te rugăm să introduci o valoare cu o extensie validă.",
maxlength: $.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."),
minlength: $.validator.format("Te rugăm să introduci cel puțin {0} caractere."),
rangelength: $.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."),
range: $.validator.format("Te rugăm să introduci o valoare între {0} și {1}."),
max: $.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."),
min: $.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: RU (Russian; русский язык)
*/
$.extend($.validator.messages, {
required: "Это поле необходимо заполнить.",
remote: "Пожалуйста, введите правильное значение.",
email: "Пожалуйста, введите корректный адрес электронной почты.",
url: "Пожалуйста, введите корректный URL.",
date: "Пожалуйста, введите корректную дату.",
dateISO: "Пожалуйста, введите корректную дату в формате ISO.",
number: "Пожалуйста, введите число.",
digits: "Пожалуйста, вводите только цифры.",
creditcard: "Пожалуйста, введите правильный номер кредитной карты.",
equalTo: "Пожалуйста, введите такое же значение ещё раз.",
extension: "Пожалуйста, выберите файл с правильным расширением.",
maxlength: $.validator.format("Пожалуйста, введите не больше {0} символов."),
minlength: $.validator.format("Пожалуйста, введите не меньше {0} символов."),
rangelength: $.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."),
range: $.validator.format("Пожалуйста, введите число от {0} до {1}."),
max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."),
min: $.validator.format("Пожалуйста, введите число, большее или равное {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: SI (Slovenian)
*/
$.extend($.validator.messages, {
required: "To polje je obvezno.",
remote: "Vpis v tem polju ni v pravi obliki.",
email: "Prosimo, vnesite pravi email naslov.",
url: "Prosimo, vnesite pravi URL.",
date: "Prosimo, vnesite pravi datum.",
dateISO: "Prosimo, vnesite pravi datum (ISO).",
number: "Prosimo, vnesite pravo številko.",
digits: "Prosimo, vnesite samo številke.",
creditcard: "Prosimo, vnesite pravo številko kreditne kartice.",
equalTo: "Prosimo, ponovno vnesite enako vsebino.",
extension: "Prosimo, vnesite vsebino z pravo končnico.",
maxlength: $.validator.format("Prosimo, da ne vnašate več kot {0} znakov."),
minlength: $.validator.format("Prosimo, vnesite vsaj {0} znakov."),
rangelength: $.validator.format("Prosimo, vnesite od {0} do {1} znakov."),
range: $.validator.format("Prosimo, vnesite vrednost med {0} in {1}."),
max: $.validator.format("Prosimo, vnesite vrednost manjšo ali enako {0}."),
min: $.validator.format("Prosimo, vnesite vrednost večjo ali enako {0}.")
});

View file

@ -0,0 +1,20 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: SK (Slovak; slovenčina, slovenský jazyk)
*/
$.extend($.validator.messages, {
required: "Povinné zadať.",
maxlength: $.validator.format("Maximálne {0} znakov."),
minlength: $.validator.format("Minimálne {0} znakov."),
rangelength: $.validator.format("Minimálne {0} a Maximálne {1} znakov."),
email: "E-mailová adresa musí byť platná.",
url: "URL musí byť platný.",
date: "Musí byť dátum.",
number: "Musí byť číslo.",
digits: "Môže obsahovať iba číslice.",
equalTo: "Dva hodnoty sa musia rovnať.",
range: $.validator.format("Musí byť medzi {0} a {1}."),
max: $.validator.format("Nemôže byť viac ako{0}."),
min: $.validator.format("Nemôže byť menej ako{0}."),
creditcard: "Číslo platobnej karty musí byť platné."
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Language: SL (Slovenian; slovenski jezik)
*/
$.extend($.validator.messages, {
required: "To polje je obvezno.",
remote: "Prosimo popravite to polje.",
email: "Prosimo vnesite veljaven email naslov.",
url: "Prosimo vnesite veljaven URL naslov.",
date: "Prosimo vnesite veljaven datum.",
dateISO: "Prosimo vnesite veljaven ISO datum.",
number: "Prosimo vnesite veljavno število.",
digits: "Prosimo vnesite samo števila.",
creditcard: "Prosimo vnesite veljavno številko kreditne kartice.",
equalTo: "Prosimo ponovno vnesite vrednost.",
extension: "Prosimo vnesite vrednost z veljavno končnico.",
maxlength: $.validator.format("Prosimo vnesite največ {0} znakov."),
minlength: $.validator.format("Prosimo vnesite najmanj {0} znakov."),
rangelength: $.validator.format("Prosimo vnesite najmanj {0} in največ {1} znakov."),
range: $.validator.format("Prosimo vnesite vrednost med {0} in {1}."),
max: $.validator.format("Prosimo vnesite vrednost manjše ali enako {0}."),
min: $.validator.format("Prosimo vnesite vrednost večje ali enako {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: SR (Serbian; српски језик)
*/
$.extend($.validator.messages, {
required: "Поље је обавезно.",
remote: "Средите ово поље.",
email: "Унесите исправну и-мејл адресу.",
url: "Унесите исправан URL.",
date: "Унесите исправан датум.",
dateISO: "Унесите исправан датум (ISO).",
number: "Унесите исправан број.",
digits: "Унесите само цифе.",
creditcard: "Унесите исправан број кредитне картице.",
equalTo: "Унесите исту вредност поново.",
extension: "Унесите вредност са одговарајућом екстензијом.",
maxlength: $.validator.format("Унесите мање од {0} карактера."),
minlength: $.validator.format("Унесите барем {0} карактера."),
rangelength: $.validator.format("Унесите вредност дугачку између {0} и {1} карактера."),
range: $.validator.format("Унесите вредност између {0} и {1}."),
max: $.validator.format("Унесите вредност мању или једнаку {0}."),
min: $.validator.format("Унесите вредност већу или једнаку {0}.")
});

View file

@ -0,0 +1,23 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: SR (Serbian - Latin alphabet; srpski jezik - latinica)
*/
$.extend($.validator.messages, {
required: "Polje je obavezno.",
remote: "Sredite ovo polje.",
email: "Unesite ispravnu i-mejl adresu",
url: "Unesite ispravan URL.",
date: "Unesite ispravan datum.",
dateISO: "Unesite ispravan datum (ISO).",
number: "Unesite ispravan broj.",
digits: "Unesite samo cife.",
creditcard: "Unesite ispravan broj kreditne kartice.",
equalTo: "Unesite istu vrednost ponovo.",
extension: "Unesite vrednost sa odgovarajućom ekstenzijom.",
maxlength: $.validator.format("Unesite manje od {0} karaktera."),
minlength: $.validator.format("Unesite barem {0} karaktera."),
rangelength: $.validator.format("Unesite vrednost dugačku između {0} i {1} karaktera."),
range: $.validator.format("Unesite vrednost između {0} i {1}."),
max: $.validator.format("Unesite vrednost manju ili jednaku {0}."),
min: $.validator.format("Unesite vrednost veću ili jednaku {0}.")
});

Some files were not shown because too many files have changed in this diff Show more