diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..5c5d571 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,50 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + - master + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 2c08b98..9fd602a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -dist -node_modules -config.json +/.jekyll-cache/ +/_site/ +/Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..6f5d4ad --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.3" +gem "webrick", "~> 1.8" # Required for Jekyll 4 on Ruby 3.0+ + +group :jekyll_plugins do + gem "jekyll-feed", "~> 0.17" +end diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index dfc6e63..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = function( grunt ) { - -grunt.loadNpmTasks( "grunt-jquery-content" ); - -grunt.initConfig({ - xmllint: { - all: [ - "entries/**", - "categories.xml", - "entries2html.xsl", - "notes.xsl" - ] - }, - "build-posts": { - page: "pages/**" - }, - "build-xml-entries": { - all: "entries/**" - }, - "build-resources": { - all: "resources/**" - }, - wordpress: (function() { - var config = require( "./config" ); - config.dir = "dist/wordpress"; - return config; - })() -}); - -grunt.registerTask( "lint", [ "xmllint" ] ); - -grunt.registerTask( "build", [ - "build-posts", - "build-resources", - "build-xml-entries", - "build-xml-categories", - "build-xml-full" -]); - -}; diff --git a/README.md b/README.md index 6308039..0da33a8 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,67 @@ -jqueryvalidation-content -======================== +# jQuery Validation Plugin - Content Repository -## Building +This repository contains the documentation and content for the [jQuery Validation Plugin](https://github.com/jquery-validation/jquery-validation) website. -### Requirements +## GitHub Pages Deployment -* libxml2 -* libxslt +This site is automatically deployed to GitHub Pages using Jekyll. -The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from GnuWin32. +### How it Works -* Install [WordPress](http://wordpress.org/download/) -* Install [jqueryvalidation-theme](https://github.com/jzaefferer/validation-theme) - clone that repo, then symlink it into your `wp-content/themes` folder -* Install [gilded-wordpress plugin](https://raw.githubusercontent.com/scottgonzalez/gilded-wordpress/v1.0.0/gilded-wordpress.php) -* Install [jquery-static-index plugin](https://raw.githubusercontent.com/jquery/jquery-wp-content/v4.0.1/plugins/jquery-static-index.php) +- Content is written in Markdown with Jekyll front matter +- The site is built using Jekyll (configured in `_config.yml`) +- GitHub Actions automatically builds and deploys the site when changes are pushed to the `main` or `master` branch +- The workflow is defined in `.github/workflows/deploy-pages.yml` -### Installation +### Local Development -In this repo: -* Make sure nodejs (with npm) is installed, otherwise install from nodejs.org -* `cp config-sample.json config.json`, edit config.json to match login for local WordPress -* run `npm install -g grunt-cli` -* run `npm install` +To test the site locally: -### Hacks +1. Install Ruby 2.7 or higher and Bundler: + ```bash + gem install bundler + ``` -* Make sure your local `wordpress` nodejs module contains [this commit](https://github.com/scottgonzalez/node-wordpress/commit/2b19238cf8064dafb66b9db09d0adcc9eac7f724) -* Make sure your local config contains - * rpc-auth and basic-auth credentials - * a https jqueryvalidation url +2. Install dependencies: + ```bash + bundle install + ``` -### Deploy +3. Run Jekyll locally: + ```bash + bundle exec jekyll serve + ``` -`grunt deploy` +4. Open your browser to `http://localhost:4000/validation-content/` + +**Note:** This site uses Jekyll 4.x. If you encounter issues, ensure you have Ruby 2.7 or higher installed. + +### Making Changes + +1. Edit or create Markdown files (`.md`) in the root directory +2. Each file should have Jekyll front matter at the top: + ```yaml + --- + layout: default + title: Your Page Title + --- + ``` +3. Commit and push your changes +4. GitHub Actions will automatically build and deploy the site + +### Content Structure + +- `index.md` - Home page +- `documentation.md` - API documentation +- `contribute.md` - Contribution guide +- `reference.md` - General guidelines and reference +- `_entries/` - Markdown documentation entries (for API methods, converted from XML) +- `_layouts/` - Jekyll layout templates + +### Deployment + +The site is automatically deployed via GitHub Actions when: +- Changes are pushed to `main` or `master` branch +- The workflow can also be triggered manually from the Actions tab + +No manual deployment is required! diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..f412d00 --- /dev/null +++ b/_config.yml @@ -0,0 +1,32 @@ +title: jQuery Validation Plugin +description: Site content for the jQuery Validation Plugin +url: https://jquery-validation.github.io +baseurl: "" + +# Build settings +markdown: kramdown +kramdown: + input: GFM + syntax_highlighter: rouge + +# Exclude from processing +exclude: + - README.md + - LICENSE-MIT.txt + - .gitignore + - .gitattributes + - Gemfile + - Gemfile.lock + +# Collections +collections: + entries: + output: true + permalink: /:name/ + +defaults: + - scope: + path: "" + type: "entries" + values: + layout: "default" diff --git a/_entries/Validator.destroy.md b/_entries/Validator.destroy.md new file mode 100644 index 0000000..12561b5 --- /dev/null +++ b/_entries/Validator.destroy.md @@ -0,0 +1,38 @@ +--- +title: Validator.destroy() +entry_name: Validator.destroy +entry_type: method +category: validator +layout: default +--- + +# Validator.destroy() + +Destroys this instance of validator freeing up resources and unregistering events. + +## Description + +This is only useful, when you need to clean up after the validator in a Single Page Application. + +## Usage + + +## Examples + +Destroying an instance of validator. + +```javascript +/* + * On SPA page start. + */ +var validator = $( "#myform" ).validate(); + +/* + * Just before SPA page's navigation away. + */ +validator.destroy(); + +/* + * After this point the #myForm form is back to its original boring state. + */ +``` diff --git a/_entries/Validator.element.md b/_entries/Validator.element.md new file mode 100644 index 0000000..c0a6102 --- /dev/null +++ b/_entries/Validator.element.md @@ -0,0 +1,30 @@ +--- +title: Validator.element() +entry_name: Validator.element +entry_type: method +category: validator +layout: default +--- + +# Validator.element() + +Validates a single element, returns true if it is valid, false otherwise. + +## Description + +This behaves as validation on blur or keyup, but returns the result. + +## Usage + +**element** *(Selector)* + +An element to validate, must be inside the validated form. + +## Examples + +Triggers element validation programmatically. + +```javascript +var validator = $( "#myform" ).validate(); +validator.element( "#myselect" ); +``` diff --git a/_entries/Validator.form.md b/_entries/Validator.form.md new file mode 100644 index 0000000..491dd02 --- /dev/null +++ b/_entries/Validator.form.md @@ -0,0 +1,27 @@ +--- +title: Validator.form() +entry_name: Validator.form +entry_type: method +category: validator +layout: default +--- + +# Validator.form() + +Validates the form, returns true if it is valid, false otherwise. + +## Description + +This behaves as a normal submit event, but returns the result. + +## Usage + + +## Examples + +Triggers form validation programmatically. + +```javascript +var validator = $( "#myform" ).validate(); +validator.form(); +``` diff --git a/_entries/Validator.numberOfInvalids.md b/_entries/Validator.numberOfInvalids.md new file mode 100644 index 0000000..b1e948a --- /dev/null +++ b/_entries/Validator.numberOfInvalids.md @@ -0,0 +1,33 @@ +--- +title: Validator.numberOfInvalids() +entry_name: Validator.numberOfInvalids +entry_type: method +category: validator +layout: default +--- + +# Validator.numberOfInvalids() + +Returns the number of invalid fields. + +## Description + +This depends on the internal validator state. It covers all fields only after validating the complete form (on submit or via $("form").valid()). After validating a single element, only that element is counted. Most useful in combination with the invalidHandler-option. + +## Usage + +**errors** *(Object)* + +One or more key/value pairs of input names and messages. + +## Examples + +Displays a summary of invalid fields after an invalid submit. + +```javascript +var validator = $( "#myform" ).validate({ + invalidHandler: function() { + $( "#summary" ).text( validator.numberOfInvalids() + " field(s) are invalid" ); + } +}); +``` diff --git a/_entries/Validator.resetForm.md b/_entries/Validator.resetForm.md new file mode 100644 index 0000000..18539a7 --- /dev/null +++ b/_entries/Validator.resetForm.md @@ -0,0 +1,27 @@ +--- +title: Validator.resetForm() +entry_name: Validator.resetForm +entry_type: method +category: validator +layout: default +--- + +# Validator.resetForm() + +Resets the controlled form. + +## Description + +Resets input fields to their original value (requires form plugin), removes classes indicating invalid elements and hides error messages. + +## Usage + + +## Examples + +Reset the form controlled by this validator. + +```javascript +var validator = $( "#myform" ).validate(); +validator.resetForm(); +``` diff --git a/_entries/Validator.showErrors.md b/_entries/Validator.showErrors.md new file mode 100644 index 0000000..db1d879 --- /dev/null +++ b/_entries/Validator.showErrors.md @@ -0,0 +1,32 @@ +--- +title: Validator.showErrors() +entry_name: Validator.showErrors +entry_type: method +category: validator +layout: default +--- + +# Validator.showErrors() + +Show the specified messages. + +## Description + +Keys have to refer to the names of elements, values are displayed for those elements, using the configured error placement. + +## Usage + +**errors** *(Object)* + +One or more key/value pairs of input names and messages. + +## Examples + +Adds and shows error message programmatically. + +```javascript +var validator = $( "#myshowErrors" ).validate(); +validator.showErrors({ + "firstname": "I know that your firstname is Pete, Pete!" +}); +``` diff --git a/_entries/accept-method.md b/_entries/accept-method.md new file mode 100644 index 0000000..80372d4 --- /dev/null +++ b/_entries/accept-method.md @@ -0,0 +1,44 @@ +--- +title: accept method +entry_name: accept +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# accept method + +Makes a file upload accept only specified mime-types. + +## Description + +Uses the HTML5 file API to look at the type attribute of one or more selected files and validate that each matches the specified mime-type. If nothing is specified, only images are allowed (image/*). You can specify multiple mime-types by separating them with a comma, e.g. "image/x-eps,application/pdf". Works with type="file" inputs. Part of the additional-methods.js file Note: This method used to look at just the filename, specifically the file extension. That behaviour is now available as the "extension" method inside src/additional/extension.js. + +## Usage + +**mimetype** *(String)* + +The allowed type, seperated via ",", defaults to "image/*" + +## Examples + +Required, only audio files allowed: + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + accept: "audio/*" + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/blank-selector.md b/_entries/blank-selector.md new file mode 100644 index 0000000..48c5d2c --- /dev/null +++ b/_entries/blank-selector.md @@ -0,0 +1,35 @@ +--- +title: :blank Selector +entry_name: blank +entry_type: selector +category: selectors +layout: default +--- + +# :blank Selector + +**Selector:** `:blank` + +Selects all elements with a blank value. + +## Description + +Blank means either no value at all or only whitespace. The implementation does a check like this: `jQuery.trim(value).length == 0` + +## Usage + + +## Examples + +Finds input elements with no value or just whitespace. + +```javascript +$( "input:blank" ).css( "background-color", "#bbbbff" ); +``` + +```html +
Mouseover to see the value of each input
+ + + +``` diff --git a/_entries/creditcard-method.md b/_entries/creditcard-method.md new file mode 100644 index 0000000..444cd64 --- /dev/null +++ b/_entries/creditcard-method.md @@ -0,0 +1,38 @@ +--- +title: creditcard method +entry_name: creditcard +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# creditcard method + +Makes the element require a credit card number. + +## Description + +Return true if the value is a valid credit card number. Works with text inputs. Part of the additional-methods.js file Note: The algorithm used can't verify the validity of the number - it is just an integrity check. As with any other clientside validation, you have to implement the same or better validation on the serverside. + +## Examples + +Makes "field" required and credit card only. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + creditcard: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/date-method.md b/_entries/date-method.md new file mode 100644 index 0000000..521da0c --- /dev/null +++ b/_entries/date-method.md @@ -0,0 +1,38 @@ +--- +title: "[DEPRECATED] date method" +entry_name: date +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# [DEPRECATED] date method + +Makes the element require a date. + +## Description + +Return true if the value is a valid date. Uses JavaScript's built-in Date to test if the date is valid, and therefore does no sanity checks. Only the format must be valid, not the actual date, eg 30/30/2008 is a valid date. DEPRECATION warning: This method is deprecated and will be removed in version 2.0.0.Please don't use it, since it relies on the Date constructor, which behaves very differently across browsers and locales. Use dateISO instead or one of the locale specific methods (in localizations/ and additional-methods.js). + +## Examples + +Makes "field" required and a date. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + date: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/dateISO-method.md b/_entries/dateISO-method.md new file mode 100644 index 0000000..8486568 --- /dev/null +++ b/_entries/dateISO-method.md @@ -0,0 +1,38 @@ +--- +title: dateISO method +entry_name: dateISO +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# dateISO method + +Makes the element require an ISO date. + +## Description + +Return true if the value is a valid date according to ISO date standard. Works with text inputs. + +## Examples + +Makes "field" required and an ISO date. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + dateISO: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/digits-method.md b/_entries/digits-method.md new file mode 100644 index 0000000..9182bc0 --- /dev/null +++ b/_entries/digits-method.md @@ -0,0 +1,38 @@ +--- +title: digits method +entry_name: digits +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# digits method + +Makes the element require digits only. + +## Description + +Returns true if the value contains only digits. Works with text inputs. + +## Examples + +Makes "field" required and digits only. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + digits: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/email-method.md b/_entries/email-method.md new file mode 100644 index 0000000..5e9d360 --- /dev/null +++ b/_entries/email-method.md @@ -0,0 +1,38 @@ +--- +title: email method +entry_name: email +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# email method + +Makes the element require a valid email + +## Description + +Return true if the value is a valid email address. Works with text inputs. IMPORTANT NOTE: As of version 1.12.0 we started using the same regular expression that the HTML5 specification suggests for browsers to use. We will follow their lead and use the same check. In case you need to adjust the built-in validation regular expression patterns, please use the $.validator.methods property. If you have different requirements, please consider using a custom method. + +## Examples + +Makes "field" required and an email address. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + email: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/equalTo-method.md b/_entries/equalTo-method.md new file mode 100644 index 0000000..7a40668 --- /dev/null +++ b/_entries/equalTo-method.md @@ -0,0 +1,47 @@ +--- +title: equalTo method +entry_name: equalTo +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# equalTo method + +Requires the element to be the same as another one + +## Description + +Returns true if the value has the same value as the element specified by the first parameter. + +## Usage + +**other** *(Selector)* + +The selector for the element to compare the current values + +## Examples + +Makes "field" required to be the same as #other + +```javascript +$( "#myform" ).validate({ + rules: { + password: "required", + password_again: { + equalTo: "#password" + } + } +}); +``` + +```html + + +
+ + +
+ +``` diff --git a/_entries/extension-method.md b/_entries/extension-method.md new file mode 100644 index 0000000..d9491e3 --- /dev/null +++ b/_entries/extension-method.md @@ -0,0 +1,44 @@ +--- +title: extension method +entry_name: extension +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# extension method + +Makes the element require a certain file extension. + +## Description + +Returns true if the value ends with one of the specified file extensions. If nothing is specified, only images are allowed (png, jpeg, gif). Works with text inputs. Part of the additional-methods.js file + +## Usage + +**extension** *(String)* (optional) + +The allowed file extensions, seperated with "|" (or a comma, ","), defaults to "png|jpe?g|gif". + +## Examples + +Makes "field" required and ending with ".xls" or ".csv". + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + extension: "xls|csv" + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/filled-selector.md b/_entries/filled-selector.md new file mode 100644 index 0000000..9e35f3b --- /dev/null +++ b/_entries/filled-selector.md @@ -0,0 +1,35 @@ +--- +title: :filled Selector +entry_name: filled +entry_type: selector +category: selectors +layout: default +--- + +# :filled Selector + +**Selector:** `:filled` + +Selects all elements with a filled value. + +## Description + +filled means any value, but not only whitespace. The implementation does a check like this: `jQuery.trim(value).length > 0` + +## Usage + + +## Examples + +Finds input elements with a non-whitespace value. + +```javascript +$( "input:filled" ).css( "background-color", "#bbbbff" ); +``` + +```html +
Mouseover to see the value of each input
+ + + +``` diff --git a/_entries/jQuery.validator.addClassRules.md b/_entries/jQuery.validator.addClassRules.md new file mode 100644 index 0000000..1af97a0 --- /dev/null +++ b/_entries/jQuery.validator.addClassRules.md @@ -0,0 +1,61 @@ +--- +title: jQuery.validator.addClassRules() +entry_name: jQuery.validator.addClassRules +entry_type: method +category: validator +layout: default +--- + +# jQuery.validator.addClassRules() + +Add a compound class method - useful to refactor common combinations of rules into a single class. + +## Usage + +### Form 1 + +**name** *(String)* + +The name of the class rule to add + +**rules** *(Object)* + +The compound rules (see example) + +### Form 2 + +**rules** *(Object)* + +A map of className-rules pairs (see example). + +## Examples + +### Example 1 + +Add a new compound rule called "name", replacing class="required" minlength="2" with class="name". + +```javascript +jQuery.validator.addClassRules("name", { + required: true, + minlength: 2 +}); +``` + +### Example 2 + +Add two compound class rules for name and zip. + +```javascript +jQuery.validator.addClassRules({ + name: { + required: true, + minlength: 2 + }, + zip: { + required: true, + digits: true, + minlength: 5, + maxlength: 5 + } +}); +``` diff --git a/_entries/jQuery.validator.addMethod.md b/_entries/jQuery.validator.addMethod.md new file mode 100644 index 0000000..a776c3c --- /dev/null +++ b/_entries/jQuery.validator.addMethod.md @@ -0,0 +1,74 @@ +--- +title: jQuery.validator.addMethod() +entry_name: jQuery.validator.addMethod +entry_type: method +category: validator +layout: default +--- + +# jQuery.validator.addMethod() + +Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message. + +## Description + +For simple one-off validation, you can use the bundled `pattern` method (in additional methods, source in `src/additional/pattern.js`) to validate a field against a regular expression. In general, it is a good idea to encapsulate those regular expressions inside their own method. If you need lots of slightly different expressions, try to extract a common parameter. See also a [library of regular expressions](http://regexlib.com/DisplayPatterns.aspx). + +## Usage + +**name** *(String)* + +The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier + +**method** *(Function)* + +The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. + + **value** *(String)* + + the current value of the validated element + + **element** *(Element)* + + the element to be validated + + **params** *(Object)* + + parameters specified for the method, e.g. for min: 5, the parameter is 5, for range: [1, 5] it's [1, 5] + +**message** *(String)* (optional) + +The default message to display for this method. Can be a function created by ''jQuery.validator.format(value)''. When undefined, an existing message is used (handy for localization), otherwise the field-specific messages have to be defined. + +## Examples + +### Example 1 + +Add a validation method that checks if a value starts with a certain domain. + +```javascript +jQuery.validator.addMethod("domain", function(value, element) { + return this.optional(element) || /^http:\/\/mycorporatedomain.com/.test(value); +}, "Please specify the correct domain for your documents"); +``` + +### Example 2 + +Adds a validation method that checks if a given value equals the addition of the two parameters. + +```javascript +jQuery.validator.addMethod("math", function(value, element, params) { + return this.optional(element) || value == params[0] + params[1]; +}, jQuery.validator.format("Please enter the correct value for {0} + {1}")); +``` + +### Example 3 + +Adds a custom email validation method that is less strict than the one built-in. + +```javascript +jQuery.validator.addMethod("laxEmail", function(value, element) { + // allow any non-whitespace characters as the host part + return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@(?:\S{1,63})$/.test( value ); +}, 'Please enter a valid email address.'); +``` diff --git a/_entries/jQuery.validator.format.md b/_entries/jQuery.validator.format.md new file mode 100644 index 0000000..a650b81 --- /dev/null +++ b/_entries/jQuery.validator.format.md @@ -0,0 +1,39 @@ +--- +title: jQuery.validator.format() +entry_name: jQuery.validator.format +entry_type: method +category: validator +layout: default +--- + +# jQuery.validator.format() + +Replaces {n} placeholders with arguments. + +## Description + +One or more arguments can be passed, in addition to the string template itself, to insert into the string. If you're familiar with the term, this makes this function support currying. If you don't care about that, just use the first argument. + +## Usage + +**template** *(String)* + +The string to format. + +**argument** *(Object)* + +The first argument to insert, or an array of Strings to insert + +**argumentN...** *(Object)* + +The second etc. argument to insert + +## Examples + +Sets the debug setting for all validation calls. + +```javascript +var template = jQuery.validator.format("{0} is not a valid value"); +// later, results in 'abc is not a valid value' +alert(template("abc")); +``` diff --git a/_entries/jQuery.validator.methods.md b/_entries/jQuery.validator.methods.md new file mode 100644 index 0000000..3b2be3f --- /dev/null +++ b/_entries/jQuery.validator.methods.md @@ -0,0 +1,21 @@ +--- +title: jQuery.validator.methods +entry_name: jQuery.validator.methods +entry_type: method +category: validator +layout: default +--- + +# jQuery.validator.methods + +Object holding all validation methods known to the validator. This can be accessed to override individual methods, while keeping the default messages. + +## Examples + +Sets a custom email pattern for the built-in email validation rule. + +```javascript +$.validator.methods.email = function( value, element ) { + return this.optional( element ) || /[a-z]+@[a-z]+\.[a-z]+/.test( value ); +} +``` diff --git a/_entries/jQuery.validator.setDefaults.md b/_entries/jQuery.validator.setDefaults.md new file mode 100644 index 0000000..89fa70f --- /dev/null +++ b/_entries/jQuery.validator.setDefaults.md @@ -0,0 +1,31 @@ +--- +title: jQuery.validator.setDefaults() +entry_name: jQuery.validator.setDefaults +entry_type: method +category: validator +layout: default +--- + +# jQuery.validator.setDefaults() + +Modify default settings for validation. + +## Description + +Accepts everything that [validate()](/validate) accepts. + +## Usage + +**options** *(Object)* + +Options to set as default. + +## Examples + +Sets the debug setting for all validation calls. + +```javascript +jQuery.validator.setDefaults({ + debug: true +}); +``` diff --git a/_entries/max-method.md b/_entries/max-method.md new file mode 100644 index 0000000..60150d7 --- /dev/null +++ b/_entries/max-method.md @@ -0,0 +1,44 @@ +--- +title: max method +entry_name: max +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# max method + +Makes the element require a given maximum. + +## Description + +Works with text inputs. To exclude the maximum value, subtract Number.MIN_VALUE from that value. + +## Usage + +**value** *(Number)* + +Maximum value required + +## Examples + +Makes "field" required and 23 or smaller. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + max: 23 + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/maxlength-method.md b/_entries/maxlength-method.md new file mode 100644 index 0000000..0583a03 --- /dev/null +++ b/_entries/maxlength-method.md @@ -0,0 +1,44 @@ +--- +title: maxlength method +entry_name: maxlength +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# maxlength method + +Makes the element require a given maximum length. + +## Description + +Return false if the element is some kind of text input and its value is too long a set of checkboxes that has too many boxes checked a select and has too many options selected Works with text inputs, selects and checkboxes. + +## Usage + +**length** *(Number)* + +Maximum number of characters required + +## Examples + +Makes "field" required having at most 4 characters. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + maxlength: 4 + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/min-method.md b/_entries/min-method.md new file mode 100644 index 0000000..7736bea --- /dev/null +++ b/_entries/min-method.md @@ -0,0 +1,44 @@ +--- +title: min method +entry_name: min +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# min method + +Makes the element require a given minimum. + +## Description + +Works with text inputs. To exclude the minimum value, add Number.MIN_VALUE to that value. + +## Usage + +**value** *(Number)* + +Minimum value required + +## Examples + +Makes "field" required and 13 or larger. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + min: 13 + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/minlength-method.md b/_entries/minlength-method.md new file mode 100644 index 0000000..beb4e14 --- /dev/null +++ b/_entries/minlength-method.md @@ -0,0 +1,44 @@ +--- +title: minlength method +entry_name: minlength +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# minlength method + +Makes the element require a given minimum length. + +## Description + +Return false if the element is some kind of text input and its value is too short a set of checkboxes that doesn't have enough boxes checked a select and doesn't have enough options selected Works with text inputs, selects and checkboxes. + +## Usage + +**length** *(Number)* + +Minimum number of characters required + +## Examples + +Makes "field" required having at least 3 characters. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + minlength: 3 + } + } +}); +``` + +```html + + +
+ +``` diff --git a/entries/normalizer.xml b/_entries/normalizer.md similarity index 53% rename from entries/normalizer.xml rename to _entries/normalizer.md index aa13830..cb15ecd 100644 --- a/entries/normalizer.xml +++ b/_entries/normalizer.md @@ -1,25 +1,33 @@ - - - normalizer - - - The value of the element. - - - Prepares/transforms the elements value for validation. - -

Transform the value of an element and the result for validation instead of the initial value. The normalizer can be defined global to all elements or local to only one element. With that said, the local normalizer will only run for the element for which it was defined. The global normalizer will run for all validated elements. This normalizer can be then overrided for each element, as needed, by attaching one to it. This way only the local one will run for that element, and the global one will run for others.

-

Note that this method:

- -
- - Makes "field" required and use a normalizer to trim its value before validating - -Required:
-]]> -
- - Makes "url" required and use a normalizer to append 'http://', if not present, to the value of the "url" element before validating - -url:
-]]> -
+``` + +### Example 3 - - Using a global normalizer in conjunction with a local one - -Required:
@@ -122,7 +136,4 @@ $( "#myform" ).validate( {
-]]> -
- -
+``` diff --git a/_entries/number-method.md b/_entries/number-method.md new file mode 100644 index 0000000..db36c62 --- /dev/null +++ b/_entries/number-method.md @@ -0,0 +1,38 @@ +--- +title: number method +entry_name: number +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# number method + +Makes the element require a decimal number. + +## Description + +Returns true if the value contains a valid decimal number. Works with text inputs. + +## Examples + +Makes "field" required and a decimal number only. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + number: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/phoneUS-method.md b/_entries/phoneUS-method.md new file mode 100644 index 0000000..e7770c7 --- /dev/null +++ b/_entries/phoneUS-method.md @@ -0,0 +1,38 @@ +--- +title: phoneUS method +entry_name: phoneUS +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# phoneUS method + +Validate for valid US phone number. + +## Description + +Works with text inputs. Part of the additional-methods.js file + +## Examples + +Makes "field" required and a US phone number. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + phoneUS: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/range-method.md b/_entries/range-method.md new file mode 100644 index 0000000..a1071cc --- /dev/null +++ b/_entries/range-method.md @@ -0,0 +1,44 @@ +--- +title: range method +entry_name: range +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# range method + +Makes the element require a given value range. + +## Description + +Works with text inputs. To exclude the maximum value, subtract Number.MIN_VALUE from that value. To exclude the minimum value, add Number.MIN_VALUE to that value. + +## Usage + +**range** *(Array)* + +Value range required + +## Examples + +Makes "field" required and between 13 and 23. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + range: [13, 23] + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/rangelength-method.md b/_entries/rangelength-method.md new file mode 100644 index 0000000..557377f --- /dev/null +++ b/_entries/rangelength-method.md @@ -0,0 +1,44 @@ +--- +title: rangelength method +entry_name: rangelength +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# rangelength method + +Makes the element require a given value range. + +## Description + +Return false if the element is some kind of text input and its length is too short or too long a set of checkboxes that doesn't have enough, or has too many boxes checked a select that doesn't have enough, or has too many options selected Works with text inputs, selects and checkboxes. + +## Usage + +**range** *(Array)* + +Value range required + +## Examples + +Makes "field" required and between 2 and 6 characters long. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + rangelength: [2, 6] + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/remote-method.md b/_entries/remote-method.md new file mode 100644 index 0000000..81b0e1d --- /dev/null +++ b/_entries/remote-method.md @@ -0,0 +1,64 @@ +--- +title: remote method +entry_name: remote +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# remote method + +Requests a resource to check the element for validity. + +## Description + +The serverside resource is called via jQuery.ajax (XMLHttpRequest) and gets a key/value pair corresponding to the name of the validated element and its value as a GET parameter. The serverside response must be a JSON string that must be `"true"` for valid elements, and can be `"false"`, `undefined`, or `null` for invalid elements, using the default error message. If the serverside response is a string, eg. `"That name is already taken, try peter123 instead"`, this string will be displayed as a custom error message in place of the default. For more examples, take a look the [marketo demo](//jqueryvalidation.org/files/demo/marketo) and the [milk demo](//jqueryvalidation.org/files/demo/milk/). + +## Usage + +**options** *(Object)* + +For the URL of the resource to request for serverside validation (String) or options to fully customize the request, see [jQuery.ajax](https://api.jquery.com/jQuery.ajax) for details. These options deep-extend the defaults (`dataType:"json", data:{nameOfTheElement:valueOfTheElement}`). Any options you provide will override the defaults. + +## Examples + +### Example 1 + +Makes the email field required, an email and does a remote request to check if the given address is already taken. + +```javascript +$( "#myform" ).validate({ + rules: { + email: { + required: true, + email: true, + remote: "check-email.php" + } + } +}); +``` + +### Example 2 + +Makes the email field required, an email and does a remote request to check if the given address is already taken. In addition, the http method is set to "post" and the username is sent alongside the email address. + +```javascript +$( "#myform" ).validate({ + rules: { + email: { + required: true, + email: true, + remote: { + url: "check-email.php", + type: "post", + data: { + username: function() { + return $( "#username" ).val(); + } + } + } + } + } +}); +``` diff --git a/_entries/require_from_group-method.md b/_entries/require_from_group-method.md new file mode 100644 index 0000000..a5c6016 --- /dev/null +++ b/_entries/require_from_group-method.md @@ -0,0 +1,49 @@ +--- +title: require_from_group method +entry_name: require_from_group +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# require_from_group method + +Ensures a given number of fields in a group are complete. + +## Description + +In the options passed to the rule, supply the minimum number of fields within the group that must be complete and a selector to define the group. Then apply this rule to all the fields within the group. The form then cannot be submitted until at least the minimum number have been completed. Part of the additional-methods.js file + +## Examples + +Within a group of three phone numbers, ensure at least one is complete. + +```javascript +$( "#myform" ).validate({ + rules: { + mobile_phone: { + require_from_group: [1, ".phone-group"] + }, + home_phone: { + require_from_group: [1, ".phone-group"] + }, + work_phone: { + require_from_group: [1, ".phone-group"] + } + } +}); +``` + +```html + + +
+ + +
+ + +
+ +``` diff --git a/_entries/required-method.md b/_entries/required-method.md new file mode 100644 index 0000000..e6c6cbb --- /dev/null +++ b/_entries/required-method.md @@ -0,0 +1,189 @@ +--- +title: required method +entry_name: required +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# required method + +Makes the element required. + +## Description + +Return false, if the element is empty (text input) or unchecked (radio/checkbox) or if nothing is selected (select). Works with text inputs, selects, checkboxes and radio buttons. To force a user to select an option from a select box, provide an empty option element like ``. Note that white spaces are considered valid. + +## Usage + +### Form 1 + +The element is always required. + +### Form 2 + +Makes the element required, depending on the result of the given expression. + +**dependency-expression** *(String)* + +An expression (String) that is evaluated in the context of the element's form, making the field required only if the expression returns more than one element. Very often your expression will use selector filters such as `#foo:checked`, `#foo:filled`, `#foo:visible`. This plugin provides [custom selectors for that purpose](/category/selectors/). + +### Form 3 + +Makes the element required, depending on the result of the given callback. + +**dependency-callback** *(Function)* + +The function is executed with the element as it's only argument: If it returns true, the element is required. + +## Examples + +### Example 1 + +Makes "field" always required. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true + } + } +}); +``` + +```html + + +
+ +``` + +### Example 2 + +Makes the fruit select required. + +```javascript +$( "#myform" ).validate({ + rules: { + fruit: { + required: true + } + } +}); +``` + +```html + + +
+ +``` + +### Example 3 + +Makes the gender radio buttons required. + +```javascript +$( "#myform" ).validate({ + rules: { + gender: { + required: true + } + } +}); +``` + +```html + + + +
+ +``` + +### Example 4 + +Makes the agree checkbox required. + +```javascript +$( "#myform" ).validate({ + rules: { + agree: { + required: true + } + } +}); +``` + +```html + + +
+ +``` + +### Example 5 + +Makes details required only if #other is checked. + +```javascript +$( "#myform" ).validate({ + rules: { + details: { + required: "#other:checked" + } + } +}); +``` + +```html + + +
+ +
+ +``` + +### Example 6 + +Makes "parent" required only if age is below 13. + +```javascript +$( "#myform" ).validate({ + rules: { + age: { + required: true, + min: 3 + }, + parent: { + required: function(element) { + return $("#age").val() < 13; + } + } + } +}); +``` + +```html + + +
+ + +
+ +``` diff --git a/_entries/rules.md b/_entries/rules.md new file mode 100644 index 0000000..27700dc --- /dev/null +++ b/_entries/rules.md @@ -0,0 +1,85 @@ +--- +title: .rules() +entry_name: rules +entry_type: method +return_type: Object +category: plugin +layout: default +--- + +# .rules() + +Read, add and remove rules for an element. + +## Description + +Returns the validations rules for the first selected element or Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $( "form" ).validate() is called first or Removes the specified rules and returns all rules for the first matched element. There are several ways to specify validation rules. Validation methods with parameters can be specified as attributes (recommended) Validation methods without parameters can be specified as classes on the element Both can be specified using the rules-option of the validate()-method Both rules and messages can be specified using data attributes, using data-msg (a generic, not-method specific message), data-msg-[method] and data-rule-[method]. When setting, the rules can also contain a messages-object, specifying custom messages for existing or added rules. + +## Usage + +### Form 1 + +Read rules for the first element + +### Form 2 + +Add rules + +**"add"** *(String)* + +**rules** *(Object)* + +The rules to add. Accepts the same format as the rules-option of the validate-method. + +### Form 3 + +Remove rules + +**"remove"** *(String)* + +**rules** *(Object)* + +The space-seperated names of rules to remove and return. If left unspecified, removes and returns all rules. Manipulates only rules specified via rules-option or via rules("add"). + +## Examples + +### Example 1 + +Adds minlength: 2 to an element which is already required. + +```javascript +$( "#myinput" ).rules( "add", { + minlength: 2 +}); +``` + +### Example 2 + +Adds required and minlength: 2 to an element and specifies custom messages for both. + +```javascript +$( "#myinput" ).rules( "add", { + required: true, + minlength: 2, + messages: { + required: "Required input", + minlength: jQuery.validator.format("Please, at least {0} characters are necessary") + } +}); +``` + +### Example 3 + +Removes all static rules from an element. + +```javascript +$( "#myinput" ).rules( "remove" ); +``` + +### Example 4 + +Removes min and max rules from an element. + +```javascript +$( "#myinput" ).rules( "remove", "min max" ); +``` diff --git a/_entries/step-method.md b/_entries/step-method.md new file mode 100644 index 0000000..6b5e1b0 --- /dev/null +++ b/_entries/step-method.md @@ -0,0 +1,44 @@ +--- +title: step method +entry_name: step +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# step method + +Makes the element require a given step. + +## Description + +Works with text inputs. No support for input types: date, datetime, datetime-local, month, time and week. + +## Usage + +**value** *(Number)* + +Step value required + +## Examples + +Makes "field" required and step of 10. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + step: 10 + } + } +}); +``` + +```html + + +
+ +``` diff --git a/entries/unchecked-selector.xml b/_entries/unchecked-selector.md similarity index 50% rename from entries/unchecked-selector.xml rename to _entries/unchecked-selector.md index 427918a..451edda 100644 --- a/entries/unchecked-selector.xml +++ b/_entries/unchecked-selector.md @@ -1,29 +1,38 @@ - - - :unchecked Selector - :unchecked - - - Selects all elements that are unchecked. - - Inversion of :checked. - - - Finds all input elements that are unchecked. - - - - - @@ -32,7 +41,4 @@ div { color:red; }
-]]> -
- -
+``` diff --git a/_entries/url-method.md b/_entries/url-method.md new file mode 100644 index 0000000..42b6609 --- /dev/null +++ b/_entries/url-method.md @@ -0,0 +1,38 @@ +--- +title: url method +entry_name: url +entry_type: method +return_type: Boolean +category: methods +layout: default +--- + +# url method + +Makes the element require a valid url + +## Description + +Return true, if the value is a valid url. Works with text inputs. + +## Examples + +Makes "field" required and a url. + +```javascript +$( "#myform" ).validate({ + rules: { + field: { + required: true, + url: true + } + } +}); +``` + +```html + + +
+ +``` diff --git a/_entries/valid.md b/_entries/valid.md new file mode 100644 index 0000000..1ab56be --- /dev/null +++ b/_entries/valid.md @@ -0,0 +1,39 @@ +--- +title: .valid() +entry_name: valid +entry_type: method +return_type: Boolean +category: plugin +layout: default +--- + +# .valid() + +Checks whether the selected form is valid or whether all selected elements are valid. + +## Description + +[validate()](/validate) needs to be called on the form before checking it using this method. + +## Usage + + +## Examples + +Sets up validation for a form, then checks if the form is valid when clicking a button. + +```javascript +var form = $( "#myform" ); +form.validate(); +$( "button" ).click(function() { + alert( "Valid: " + form.valid() ); +}); +``` + +```html +
+ +
+ +
+``` diff --git a/_entries/validate.md b/_entries/validate.md new file mode 100644 index 0000000..15a0b53 --- /dev/null +++ b/_entries/validate.md @@ -0,0 +1,573 @@ +--- +title: .validate() +entry_name: validate +entry_type: method +return_type: Validator +category: plugin +layout: default +--- + +# .validate() + +Validates the selected form. + +## Description + +This method sets up event handlers for submit, focus, keyup, blur and click to trigger validation of the entire form or individual elements. Each one can be disabled, see the onxxx options (onsubmit, onfocusout, onkeyup, onclick). focusInvalid focuses elements when submitting an invalid form. Use the debug option to ease setting up validation rules, it always prevents the default submit, even when script errors occur. Use submitHandler to implement your own form submit, eg. via Ajax. Use invalidHandler to react when an invalid form is submitted. Use rules and messages to specify which elements to validate, and how. See [rules()](/rules) for more details about specifying validation rules. Use errorClass, errorElement, wrapper, errorLabelContainer, errorContainer, showErrors, success, errorPlacement, highlight, unhighlight, and ignoreTitle to control how invalid elements and error messages are displayed. + +## Usage + +**options** *(Object)* (optional) + + **debug** *(Boolean)* (default: `false`) + + Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console (will check if a `window.console` property exists). Try to enable when a form is just submitted instead of validation stopping the submit. + + **Example:** Prevents the form from submitting and tries to help setting up the validation with warnings about missing methods and other debug messages. + + ```javascript + $("#myform").validate({ + debug: true + }); + ``` + + **submitHandler** *(Function)* (default: `native form submit`) + + Callback for handling the actual submit when the form is valid. Gets the form and the submit event as the only arguments. Replaces the default submit. The right place to submit a form via Ajax after it is validated. + + **Example:** Submits the form via Ajax, using [jQuery Form plugin](http://jquery.malsup.com/form), when valid. + + ```javascript + $("#myform").validate({ + submitHandler: function(form) { + $(form).ajaxSubmit(); + } + }); + ``` + + **Example:** Use submitHandler to process something and then using the default submit. Note that "form" refers to a DOM element, this way the validation isn't triggered again. + + ```javascript + $("#myform").validate({ + submitHandler: function(form) { + // do other things for a valid form + form.submit(); + } + }); + ``` + + The callback gets passed two arguments: + + **form** *(Element)* + + The form currently being validated, as a DOMElement. + + **event** *(Event)* + + The submit event instance. + + **invalidHandler** *(Function)* + + Callback for custom code when an invalid form is submitted. Called with an event object as the first argument, and the validator as the second. + + **Example:** Displays a message above the form, indicating how many fields are invalid when the user tries to submit an invalid form. + + ```javascript + $("#myform").validate({ + invalidHandler: function(event, validator) { + // 'this' refers to the form + var errors = validator.numberOfInvalids(); + if (errors) { + var message = errors == 1 + ? 'You missed 1 field. It has been highlighted' + : 'You missed ' + errors + ' fields. They have been highlighted'; + $("div.error span").html(message); + $("div.error").show(); + } else { + $("div.error").hide(); + } + } + }); + ``` + + The callback gets passed two arguments: + + **event** *(Event)* + + A custom event object, since this function is bound as an event handler. + + **validator** *(Validator)* + + The validator instance for the current form. + + **ignore** *(Selector)* (default: `":hidden"`) + + Elements to ignore when validating, simply filtering them out. jQuery's not-method is used, therefore everything that is accepted by not() can be passed as this option. Inputs of type submit and reset are always ignored, so are disabled elements. + + **Example:** Ignores all elements with the class "ignore" when validating. + + ```javascript + $("#myform").validate({ + ignore: ".ignore" + }); + ``` + + **rules** *(Object)* (default: `rules are read from markup (classes, attributes, data)`) + + Key/value pairs defining custom rules. Key is the name of an element (or a group of checkboxes/radio buttons), value is an object consisting of rule/parameter pairs or a plain String. Can be combined with class/attribute/data rules. Each rule can be specified as having a depends-property to apply the rule only in certain conditions. See the second example below for details. + + **Example:** Specifies a name element as required and an email element as required (using the shortcut for a single rule) and a valid email address (using another object literal). + + ```javascript + $("#myform").validate({ + rules: { + // simple rule, converted to {required:true} + name: "required", + // compound rule + email: { + required: true, + email: true + } + } + }); + ``` + + **Example:** Specifies a contact element as required and as email address, the latter depending on a checkbox being checked for contact via email. + + ```javascript + $("#myform").validate({ + rules: { + contact: { + required: true, + email: { + depends: function(element) { + return $("#contactform_email").is(":checked"); + } + } + } + } + }); + ``` + + **Example:** Configure a rule that requires a parameter, along with a `depends` callback. + + ```javascript + $("#myform").validate({ + rules: { + // at least 15€ when bonus material is included + pay_what_you_want: { + required: true, + min: { + // min needs a parameter passed to it + param: 15, + depends: function(element) { + return $("#bonus-material").is(":checked"); + } + } + } + } + }); + ``` + + **messages** *(Object)* (default: `the default message for the method used`) + + Key/value pairs defining custom messages. Key is the name of an element, value the message to display for that element. Instead of a plain message, another map with specific messages for each rule can be used. Overrides the title attribute of an element or the default message for the method (in that order). Each message can be a String or a Callback. The callback is called in the scope of the validator, with the rule's parameters as the first argument and the element as the second, and must return a String to display as the message. + + **Example:** Specifies a name element as required and an email element as required and a valid email address. A single message is specified for the name element, and two messages for email. + + ```javascript + $("#myform").validate({ + rules: { + name: "required", + email: { + required: true, + email: true + } + }, + messages: { + name: "Please specify your name", + email: { + required: "We need your email address to contact you", + email: "Your email address must be in the format of name@domain.com" + } + } + }); + ``` + + **Example:** Validates the name-field as required and having at least two characters. Provides a callback message using jQuery.validator.format to avoid having to specify the parameter in two places. + + ```javascript + $("#myform").validate({ + rules: { + name: { + required: true, + minlength: 2 + } + }, + messages: { + name: { + required: "We need your email address to contact you", + minlength: jQuery.validator.format("At least {0} characters required!") + } + } + }); + ``` + + **groups** *(Object)* + + Specify grouping of error messages. A group consists of an arbitrary group name as the key and a space separated list of element names as the value. Use errorPlacement to control where the group message is placed. + + **Example:** Use a table layout for the form, placing error messages in the next cell after the input. + + ```javascript + $("#myform").validate({ + groups: { + username: "fname lname" + }, + errorPlacement: function(error, element) { + if (element.attr("name") == "fname" || element.attr("name") == "lname") { + error.insertAfter("#lastname"); + } else { + error.insertAfter(element); + } + } + }); + ``` + + **normalizer** *(Function)* + + Prepares/transforms the elements value for validation. See [normalizer docs](/normalizer/) for more details. + + **onsubmit** *(Boolean)* (default: `true`) + + Validate the form on submit. Set to false to use only other events for validation. + + **Example:** Disables onsubmit validation, allowing the user to submit whatever he wants, while still validating on keyup/blur/click events (if not specified otherwise). + + ```javascript + $("#myform").validate({ + onsubmit: false + }); + ``` + + **onfocusout** *(Boolean | Function)* + + Validate elements (except checkboxes/radio buttons) on blur. If nothing is entered, all rules are skipped, except when the field was already marked as invalid. Set to a Function to decide for yourself when to run validation. A boolean true is not a valid value. + + **Example:** Disables focusout validation. + + ```javascript + $("#myform").validate({ + onfocusout: false + }); + ``` + + The callback gets passed two arguments: + + **element** *(Element)* + + The element currently being validated, as a DOMElement. + + **event** *(Event)* + + The event object for this focusout event. + + **onkeyup** *(Boolean | Function)* + + Validate elements on keyup. As long as the field is not marked as invalid, nothing happens. Otherwise, all rules are checked on each key up event. Set to false to disable. Set to a Function to decide for yourself when to run validation. A boolean true is not a valid value. + + **Example:** Disables onkeyup validation. + + ```javascript + $("#myform").validate({ + onkeyup: false + }); + ``` + + The callback gets passed two arguments: + + **element** *(Element)* + + The element currently being validated, as a DOMElement. + + **event** *(Event)* + + The event object for this keyup event. + + **onclick** *(Boolean | Function)* + + Validate checkboxes, radio buttons, and select elements on click. Set to false to disable. Set to a Function to decide for yourself when to run validation. A boolean true is not a valid value. + + **Example:** Disables onclick validation of checkboxes, radio buttons, and select elements. + + ```javascript + $("#myform").validate({ + onclick: false + }); + ``` + + The callback gets passed two arguments: + + **element** *(Element)* + + The element currently being validated, as a DOMElement. + + **event** *(Event)* + + The event object for this click event. + + **focusInvalid** *(Boolean)* (default: `true`) + + Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one that had focus when the form was submitted, avoiding stealing its focus. If there was no element focused, the first one in the form gets it, unless this option is turned off. + + **Example:** Disables focusing of invalid elements. + + ```javascript + $("#myform").validate({ + focusInvalid: false + }); + ``` + + **focusCleanup** *(Boolean)* (default: `false`) + + If enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused. Avoid combination with focusInvalid. + + **Example:** Enables cleanup when focusing elements, removing the error class and hiding error messages when an element is focused. + + ```javascript + $("#myform").validate({ + focusCleanup: true + }); + ``` + + **errorClass** *(String)* (default: `"error"`) + + Use this class to create error labels, to look for existing error labels and to add it to invalid elements. + + **Example:** Sets the error class to "invalid". + + ```javascript + $("#myform").validate({ + errorClass: "invalid" + }); + ``` + + **validClass** *(String)* (default: `"valid"`) + + This class is added to an element after it was validated and considered valid. + + **Example:** Sets the valid class to "success". + + ```javascript + $("#myform").validate({ + validClass: "success" + }); + ``` + + **errorElement** *(String)* (default: `"label"`) + + Use this element type to create error messages and to look for existing error messages. The default, "label", has the advantage of creating a meaningful link between error message and invalid field using the for attribute (which is always used, regardless of element type). + + **Example:** Sets the error element to "em". + + ```javascript + $("#myform").validate({ + errorElement: "em" + }); + ``` + + **wrapper** *(String)* (default: `window`) + + Wrap error labels with the specified element. Useful in combination with errorLabelContainer to create a list of error messages. + + **Example:** Wrap each error element with a list item, useful when using an ordered or unordered list as the error container. + + ```javascript + $("#myform").validate({ + wrapper: "li" + }); + ``` + + **errorLabelContainer** *(Selector)* + + Hide and show this container when validating. + + **Example:** All error labels are displayed inside an unordered list with the ID "messageBox", as specified by the selector passed as errorContainer option. All error elements are wrapped inside a li element, to create a list of messages. + + ```javascript + $("#myform").validate({ + errorLabelContainer: "#messageBox", + wrapper: "li", + submitHandler: function() { alert("Submitted!") } + }); + ``` + + **errorContainer** *(Selector)* + + Hide and show this container when validating. + + **Example:** Uses an additonal container for error messages. The elements given as the errorContainer are all shown and hidden when errors occur. However, the error labels themselves are added to the element(s) given as errorLabelContainer, here an unordered list. Therefore the error labels are also wrapped into li elements (wrapper option). + + ```javascript + $("#myform").validate({ + errorContainer: "#messageBox1, #messageBox2", + errorLabelContainer: "#messageBox1 ul", + wrapper: "li", + debug:true, + submitHandler: function() { alert("Submitted!") } + }); + ``` + + **showErrors** *(Function)* + + A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second, called in the context of the validator object. The arguments contain only those elements currently validated, which can be a single element when doing validation on focusout or keyup. You can trigger (in addition to your own messages) the default behaviour by calling this.defaultShowErrors(). + + **Example:** Update the number of invalid elements each time an error is displayed. Delegates to the default implementation for the actual error display. + + ```javascript + $("#myform").validate({ + showErrors: function(errorMap, errorList) { + $("#summary").html("Your form contains " + this.numberOfInvalids() + " errors, see details below."); + this.defaultShowErrors(); + } + }); + ``` + + The callback gets passed two arguments: + + **errorMap** *(Object)* + + Key/value pairs, where the key refers to the name of an input field, values the message to be displayed for that input. + + **errorList** *(Array)* + + An array for all currently validated elements. Contains objects with the following two properties: + + **message** *(String)* + + The message to be displayed for an input. + + **element** *(Element)* + + The DOMElement for this entry. + + **errorPlacement** *(Function)* (default: `Places the error label after the invalid element`) + + Customize placement of created error labels. First argument: The created error label as a jQuery object. Second argument: The invalid element as a jQuery object. + + **Example:** Use a table layout for the form, placing error messages in the next cell after the input. + + ```javascript + $("#myform").validate({ + errorPlacement: function(error, element) { + error.appendTo( element.parent("td").next("td") ); + } + }); + ``` + + The callback gets passed two arguments: + + **error** *(jQuery)* + + The error label to insert into the DOM. + + **element** *(jQuery)* + + The validated input, for relative positioning. + + **success** *(String | Function)* + + If specified, the error label is displayed to show a valid element. If a String is given, it is added as a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element). The label can be used to add a text like "ok!". + + **Example:** Add a class "valid" to valid elements, styled via CSS. + + ```javascript + $("#myform").validate({ + success: "valid", + submitHandler: function() { alert("Submitted!") } + }); + ``` + + **Example:** Add a class "valid" to valid elements, styled via CSS, and add the text "Ok!". + + ```javascript + $("#myform").validate({ + success: function(label) { + label.addClass("valid").text("Ok!") + }, + submitHandler: function() { alert("Submitted!") } + }); + ``` + + The callback gets passed two arguments: + + **label** *(jQuery)* + + The error label. Use to add a class or replace the text content. + + **element** *(Element)* + + The element currently being validated, as a DOMElement. + + **highlight** *(Function)* (default: `Adds errorClass (see the option) to the element`) + + How to highlight invalid fields. Override to decide which fields and how to highlight. + + **Example:** Highlights an invalid element by fading it out and in again. + + ```javascript + $("#myform").validate({ + highlight: function(element, errorClass) { + $(element).fadeOut(function() { + $(element).fadeIn(); + }); + } + }); + ``` + + **Example:** Adds the error class to both the invalid element and its label + + ```javascript + $("#myform").validate({ + highlight: function(element, errorClass, validClass) { + $(element).addClass(errorClass).removeClass(validClass); + $(element.form).find("label[for=" + element.id + "]") + .addClass(errorClass); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).removeClass(errorClass).addClass(validClass); + $(element.form).find("label[for=" + element.id + "]") + .removeClass(errorClass); + } + }); + ``` + + The callback gets passed three arguments: + + **element** *(Element)* + + The invalid DOM element, usually an `input`. + + **errorClass** *(String)* + + Current value of the `errorClass` option. + + **validClass** *(String)* + + Current value of the `validClass` option. + + **unhighlight** *(Function)* (default: `Removes the errorClass`) + + Called to revert changes made by option highlight, same arguments as highlight. + + **ignoreTitle** *(Boolean)* (default: `false`) + + Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compatibility, the message-from-title is likely to be completely removed in a future release. + + **Example:** Configure the plugin to ignore title attributes on validated elements when looking for messages. + + ```javascript + $("#myform").validate({ + ignoreTitle: true + }); + ``` diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..bfcef2a --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,103 @@ + + + + + + {% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} + + + + +
+ + + + +
+ +
+ {% if page.title and page.url != "/" %} +

{{ page.title }}

+ {% endif %} + + {{ content }} +
+ + + + diff --git a/assets/jquery-validation-logo.webp b/assets/jquery-validation-logo.webp new file mode 100644 index 0000000..29ed1af Binary files /dev/null and b/assets/jquery-validation-logo.webp differ diff --git a/categories.xml b/categories.xml deleted file mode 100644 index 0ee3c94..0000000 --- a/categories.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/config-sample.json b/config-sample.json deleted file mode 100644 index fc44401..0000000 --- a/config-sample.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "url": "https://jqueryvalidation.org/", - "username": "admin", - "password": "secret", - "basicAuth": { - "username": "basic-auth-admin", - "password": "basic-auth-secret" - } -} diff --git a/pages/contribute.md b/contribute.md similarity index 93% rename from pages/contribute.md rename to contribute.md index 6b403a0..375c197 100644 --- a/pages/contribute.md +++ b/contribute.md @@ -1,6 +1,7 @@ - +--- +layout: default +title: Contribute +--- There are several ways for you to contribute to this plugin: diff --git a/pages/documentation.md b/documentation.md similarity index 99% rename from pages/documentation.md rename to documentation.md index 97fa99f..da0293a 100644 --- a/pages/documentation.md +++ b/documentation.md @@ -1,6 +1,7 @@ - +--- +layout: default +title: Documentation +--- # Validate forms like you've never validated before! diff --git a/entries/Validator.destroy.xml b/entries/Validator.destroy.xml deleted file mode 100644 index 89c9714..0000000 --- a/entries/Validator.destroy.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - Validator.destroy() - - - Destroys this instance of validator freeing up resources and unregistering events. - This is only useful, when you need to clean up after the validator in a Single Page Application. - - Destroying an instance of validator. - - - - diff --git a/entries/Validator.element.xml b/entries/Validator.element.xml deleted file mode 100644 index 1a07f94..0000000 --- a/entries/Validator.element.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Validator.element() - - - An element to validate, must be inside the validated form. - - - Validates a single element, returns true if it is valid, false otherwise. - This behaves as validation on blur or keyup, but returns the result. - - Triggers element validation programmatically. - - - - diff --git a/entries/Validator.form.xml b/entries/Validator.form.xml deleted file mode 100644 index 4868ee4..0000000 --- a/entries/Validator.form.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Validator.form() - - - Validates the form, returns true if it is valid, false otherwise. - This behaves as a normal submit event, but returns the result. - - Triggers form validation programmatically. - - - - diff --git a/entries/Validator.numberOfInvalids.xml b/entries/Validator.numberOfInvalids.xml deleted file mode 100644 index afc6df0..0000000 --- a/entries/Validator.numberOfInvalids.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - Validator.numberOfInvalids() - - - One or more key/value pairs of input names and messages. - - - Returns the number of invalid fields. - This depends on the internal validator state. It covers all fields only after validating the complete form (on submit or via $("form").valid()). After validating a single element, only that element is counted. Most useful in combination with the invalidHandler-option. - - Displays a summary of invalid fields after an invalid submit. - - - - diff --git a/entries/Validator.resetForm.xml b/entries/Validator.resetForm.xml deleted file mode 100644 index c836760..0000000 --- a/entries/Validator.resetForm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Validator.resetForm() - - - Resets the controlled form. - Resets input fields to their original value (requires form plugin), removes classes indicating invalid elements and hides error messages. - - Reset the form controlled by this validator. - - - - diff --git a/entries/Validator.showErrors.xml b/entries/Validator.showErrors.xml deleted file mode 100644 index fed646f..0000000 --- a/entries/Validator.showErrors.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Validator.showErrors() - - - One or more key/value pairs of input names and messages. - - - Show the specified messages. - Keys have to refer to the names of elements, values are displayed for those elements, using the configured error placement. - - Adds and shows error message programmatically. - - - - diff --git a/entries/accept-method.xml b/entries/accept-method.xml deleted file mode 100644 index 529c1a0..0000000 --- a/entries/accept-method.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - accept method - Makes a file upload accept only specified mime-types. - - Uses the HTML5 file API to look at the type attribute of one or more selected files and validate that each matches the specified mime-type. - -

If nothing is specified, only images are allowed (image/*).

- -

You can specify multiple mime-types by separating them with a comma, e.g. "image/x-eps,application/pdf".

- -

Works with type="file" inputs.

-

Part of the additional-methods.js file

-

Note: This method used to look at just the filename, specifically the file extension. That behaviour is now available as the "extension" method inside src/additional/extension.js.

-
- - - - The allowed type, seperated via ",", defaults to "image/*" - - - - - Required, only audio files allowed: - -Required, audio files only: - -
- -]]> -
- -
diff --git a/entries/blank-selector.xml b/entries/blank-selector.xml deleted file mode 100644 index e62284d..0000000 --- a/entries/blank-selector.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - :blank Selector - :blank - - - Selects all elements with a blank value. - - Blank means either no value at all or only whitespace. -

The implementation does a check like this: jQuery.trim(value).length == 0

-
- - Finds input elements with no value or just whitespace. - - Mouseover to see the value of each input - - - -]]> - - -
\ No newline at end of file diff --git a/entries/creditcard-method.xml b/entries/creditcard-method.xml deleted file mode 100644 index 14a18f5..0000000 --- a/entries/creditcard-method.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - creditcard method - Makes the element require a credit card number. - - Return true if the value is a valid credit card number. -

Works with text inputs.

-

Part of the additional-methods.js file

-

Note: The algorithm used can't verify the validity of the number - it is just an integrity check. As with any other clientside validation, you have to implement the same or better validation on the serverside.

-
- - Makes "field" required and credit card only. - -Required, creditcard (try 446-667-651): - -
- -]]> -
- -
diff --git a/entries/date-method.xml b/entries/date-method.xml deleted file mode 100644 index 4d2285b..0000000 --- a/entries/date-method.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - [DEPRECATED] date method - Makes the element require a date. - - Return true if the value is a valid date. Uses JavaScript's built-in Date to test if the date is valid, and therefore does no sanity checks. Only the format must be valid, not the actual date, eg 30/30/2008 is a valid date. -

DEPRECATION warning:

-

This method is deprecated and will be removed in version 2.0.0.
Please don't use it, since it relies on the Date constructor, which behaves very differently across browsers and locales. Use dateISO instead or one of the locale specific methods (in localizations/ and additional-methods.js).

-
- - Makes "field" required and a date. - -Required, date: - -
- -]]> -
- -
diff --git a/entries/dateISO-method.xml b/entries/dateISO-method.xml deleted file mode 100644 index a7b7355..0000000 --- a/entries/dateISO-method.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - dateISO method - Makes the element require an ISO date. - - Return true if the value is a valid date according to ISO date standard. -

Works with text inputs.

-
- - Makes "field" required and an ISO date. - -Required, dateISO: - -
- -]]> -
- -
diff --git a/entries/digits-method.xml b/entries/digits-method.xml deleted file mode 100644 index f88261b..0000000 --- a/entries/digits-method.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - digits method - Makes the element require digits only. - - Returns true if the value contains only digits. -

Works with text inputs.

-
- - Makes "field" required and digits only. - -Required, digits: - -
- -]]> -
- -
diff --git a/entries/email-method.xml b/entries/email-method.xml deleted file mode 100644 index b0ba4e9..0000000 --- a/entries/email-method.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - email method - Makes the element require a valid email - - Return true if the value is a valid email address. -

Works with text inputs.

-

IMPORTANT NOTE:

-

As of version 1.12.0 we started using the same regular expression that the HTML5 specification suggests for browsers to use. We will follow their lead and use the same check. In case you need to adjust the built-in validation regular expression patterns, please use the $.validator.methods property. If you have different requirements, please consider using a custom method.

-
- - Makes "field" required and an email address. - -Required, email: - -
- -]]> -
- -
diff --git a/entries/equalTo-method.xml b/entries/equalTo-method.xml deleted file mode 100644 index 6317b55..0000000 --- a/entries/equalTo-method.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - equalTo method - Requires the element to be the same as another one - - Returns true if the value has the same value as the element specified by the first parameter. - - - - - The selector for the element to compare the current values - - - - - Makes "field" required to be the same as #other - -Password - -
- - -
- -]]> -
- -
diff --git a/entries/extension-method.xml b/entries/extension-method.xml deleted file mode 100644 index 0e8ec9a..0000000 --- a/entries/extension-method.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - extension method - Makes the element require a certain file extension. - - Returns true if the value ends with one of the specified file extensions. If nothing is specified, only images are allowed (png, jpeg, gif). -

Works with text inputs.

-

Part of the additional-methods.js file

-
- - - - The allowed file extensions, seperated with "|" (or a comma, ","), defaults to "png|jpe?g|gif". - - - - - Makes "field" required and ending with ".xls" or ".csv". - -Required, only .xls and .csv files allowed: - -
- -]]> -
- -
diff --git a/entries/filled-selector.xml b/entries/filled-selector.xml deleted file mode 100644 index 2c282a8..0000000 --- a/entries/filled-selector.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - :filled Selector - :filled - - - Selects all elements with a filled value. - - filled means any value, but not only whitespace. -

The implementation does a check like this: jQuery.trim(value).length > 0

-
- - Finds input elements with a non-whitespace value. - - Mouseover to see the value of each input - - - -]]> - - -
\ No newline at end of file diff --git a/entries/jQuery.validator.addClassRules.xml b/entries/jQuery.validator.addClassRules.xml deleted file mode 100644 index a26efa9..0000000 --- a/entries/jQuery.validator.addClassRules.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - jQuery.validator.addClassRules() - - - The name of the class rule to add - - - The compound rules (see example) - - - - - A map of className-rules pairs (see example). - - - Add a compound class method - useful to refactor common combinations of rules into a single class. - - Add a new compound rule called "name", replacing class="required" minlength="2" with class="name". - - - - Add two compound class rules for name and zip. - - - - diff --git a/entries/jQuery.validator.addMethod.xml b/entries/jQuery.validator.addMethod.xml deleted file mode 100644 index 59d3fa5..0000000 --- a/entries/jQuery.validator.addMethod.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - jQuery.validator.addMethod() - - - The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier - - - The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. - - the current value of the validated element - - - the element to be validated - - - parameters specified for the method, e.g. for min: 5, the parameter is 5, for range: [1, 5] it's [1, 5] - - - - The default message to display for this method. Can be a function created by ''jQuery.validator.format(value)''. When undefined, an existing message is used (handy for localization), otherwise the field-specific messages have to be defined. - - - Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message. - -For simple one-off validation, you can use the bundled pattern method (in additional methods, source in src/additional/pattern.js) to validate a field against a regular expression. In general, it is a good idea to encapsulate those regular expressions inside their own method. If you need lots of slightly different expressions, try to extract a common parameter. - -See also a library of regular expressions. - - - Add a validation method that checks if a value starts with a certain domain. - - - - Adds a validation method that checks if a given value equals the addition of the two parameters. - - - - Adds a custom email validation method that is less strict than the one built-in. - - - - diff --git a/entries/jQuery.validator.format.xml b/entries/jQuery.validator.format.xml deleted file mode 100644 index 49c63c5..0000000 --- a/entries/jQuery.validator.format.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - jQuery.validator.format() - - - The string to format. - - - The first argument to insert, or an array of Strings to insert - - - The second etc. argument to insert - - - Replaces {n} placeholders with arguments. - - One or more arguments can be passed, in addition to the string template itself, to insert into the string. -

If you're familiar with the term, this makes this function support currying. If you don't care about that, just use the first argument.

-
- - Sets the debug setting for all validation calls. - - - -
diff --git a/entries/jQuery.validator.methods.xml b/entries/jQuery.validator.methods.xml deleted file mode 100644 index eba2d32..0000000 --- a/entries/jQuery.validator.methods.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - jQuery.validator.methods - Object holding all validation methods known to the validator. This can be accessed to override individual methods, while keeping the default messages. - - Sets a custom email pattern for the built-in email validation rule. - - - - diff --git a/entries/jQuery.validator.setDefaults.xml b/entries/jQuery.validator.setDefaults.xml deleted file mode 100644 index 7a5c7e8..0000000 --- a/entries/jQuery.validator.setDefaults.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - jQuery.validator.setDefaults() - - - Options to set as default. - - - Modify default settings for validation. - Accepts everything that validate() accepts. - - Sets the debug setting for all validation calls. - - - - diff --git a/entries/max-method.xml b/entries/max-method.xml deleted file mode 100644 index 41a947f..0000000 --- a/entries/max-method.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - max method - Makes the element require a given maximum. - - Works with text inputs. To exclude the maximum value, subtract Number.MIN_VALUE from that value. - - - - - Maximum value required - - - - - Makes "field" required and 23 or smaller. - -Required, maximum value 23: - -
- -]]> -
- -
diff --git a/entries/maxlength-method.xml b/entries/maxlength-method.xml deleted file mode 100644 index 2497acd..0000000 --- a/entries/maxlength-method.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - maxlength method - Makes the element require a given maximum length. - - Return false if the element is - -

Works with text inputs, selects and checkboxes.

-
- - - - Maximum number of characters required - - - - - Makes "field" required having at most 4 characters. - -Required, maximum length 4: - -
- -]]> -
- -
diff --git a/entries/min-method.xml b/entries/min-method.xml deleted file mode 100644 index de7e1d0..0000000 --- a/entries/min-method.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - min method - Makes the element require a given minimum. - - Works with text inputs. To exclude the minimum value, add Number.MIN_VALUE to that value. - - - - - Minimum value required - - - - - Makes "field" required and 13 or larger. - -Required, minimum 13: - -
- -]]> -
- -
diff --git a/entries/minlength-method.xml b/entries/minlength-method.xml deleted file mode 100644 index ade78e5..0000000 --- a/entries/minlength-method.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - minlength method - Makes the element require a given minimum length. - - Return false if the element is - -

Works with text inputs, selects and checkboxes.

-
- - - - Minimum number of characters required - - - - - Makes "field" required having at least 3 characters. - -Required, minimum length 3: - -
- -]]> -
- -
diff --git a/entries/number-method.xml b/entries/number-method.xml deleted file mode 100644 index 75f8a25..0000000 --- a/entries/number-method.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - number method - Makes the element require a decimal number. - - Returns true if the value contains a valid decimal number. -

Works with text inputs.

-
- - Makes "field" required and a decimal number only. - -Required, decimal number: - -
- -]]> -
- -
diff --git a/entries/phoneUS-method.xml b/entries/phoneUS-method.xml deleted file mode 100644 index 3490c7e..0000000 --- a/entries/phoneUS-method.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - phoneUS method - Validate for valid US phone number. - - Works with text inputs. -

Part of the additional-methods.js file

-
- - Makes "field" required and a US phone number. - -Required, us phone number: - -
- -]]> -
- -
diff --git a/entries/range-method.xml b/entries/range-method.xml deleted file mode 100644 index e050277..0000000 --- a/entries/range-method.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - range method - Makes the element require a given value range. - - Works with text inputs. To exclude the maximum value, subtract Number.MIN_VALUE from that value. To exclude the minimum value, add Number.MIN_VALUE to that value. - - - - - Value range required - - - - - Makes "field" required and between 13 and 23. - -Required, minimum 13, maximum 23: - -
- -]]> -
- -
diff --git a/entries/rangelength-method.xml b/entries/rangelength-method.xml deleted file mode 100644 index 4bde3e2..0000000 --- a/entries/rangelength-method.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - rangelength method - Makes the element require a given value range. - - Return false if the element is - -

Works with text inputs, selects and checkboxes.

-
- - - - Value range required - - - - - Makes "field" required and between 2 and 6 characters long. - -Required, minimum length 2, maximum length 6: - -
- -]]> -
- -
diff --git a/entries/remote-method.xml b/entries/remote-method.xml deleted file mode 100644 index 8ed7288..0000000 --- a/entries/remote-method.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - remote method - Requests a resource to check the element for validity. - - The serverside resource is called via jQuery.ajax (XMLHttpRequest) and gets a key/value pair corresponding to the name of the validated element and its value as a GET parameter. The serverside response must be a JSON string that must be "true" for valid elements, and can be "false", undefined, or null for invalid elements, using the default error message. If the serverside response is a string, eg. "That name is already taken, try peter123 instead", this string will be displayed as a custom error message in place of the default. - -

For more examples, take a look the marketo demo and the milk demo.

-
- - - - For the URL of the resource to request for serverside validation (String) or options to fully customize the request, see jQuery.ajax for details. -

These options deep-extend the defaults (dataType:"json", data:{nameOfTheElement:valueOfTheElement}). Any options you provide will override the defaults.

-
-
-
- - Makes the email field required, an email and does a remote request to check if the given address is already taken. - - - - Makes the email field required, an email and does a remote request to check if the given address is already taken. In addition, the http method is set to "post" and the username is sent alongside the email address. - - - -
diff --git a/entries/require_from_group-method.xml b/entries/require_from_group-method.xml deleted file mode 100644 index b389026..0000000 --- a/entries/require_from_group-method.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - require_from_group method - Ensures a given number of fields in a group are complete. - - In the options passed to the rule, supply the minimum number of fields - within the group that must be complete and a selector to define the - group. Then apply this rule to all the fields within the group. - The form then cannot be submitted until at least the minimum number have - been completed. -

Part of the additional-methods.js file

-
- - Within a group of three phone numbers, ensure at least one is complete. - -Mobile phone: - -
- - -
- - -
- -]]> -
- -
diff --git a/entries/required-method.xml b/entries/required-method.xml deleted file mode 100644 index 755d1aa..0000000 --- a/entries/required-method.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - required method - Makes the element required. - - Return false, if the element is empty (text input) or unchecked (radio/checkbox) or if nothing is selected (select). -

Works with text inputs, selects, checkboxes and radio buttons.

-

To force a user to select an option from a select box, provide an empty option element like <option value="">Choose...</option>

-

Note that white spaces are considered valid.

-
- - The element is always required. - - - Makes the element required, depending on the result of the given expression. - - - An expression (String) that is evaluated in the context of the element's form, making the field required only if the expression returns more than one element. -

Very often your expression will use selector filters such as #foo:checked, #foo:filled, #foo:visible. This plugin provides custom selectors for that purpose.

-
-
-
- - Makes the element required, depending on the result of the given callback. - - - The function is executed with the element as it's only argument: If it returns true, the element is required. - - - - - Makes "field" always required. - -Required: - -
- -]]> -
- - Makes the fruit select required. - -Please select a fruit - -
- -]]> -
- - Makes the gender radio buttons required. - - - - Male - - - -
- -]]> -
- - Makes the agree checkbox required. - -Please agree to our policy - -
- -]]> -
- - Makes details required only if #other is checked. - -Check to make next field required - -
- -
- -]]> -
- - Makes "parent" required only if age is below 13. - -Age - -
- - -
- -]]> -
- -
diff --git a/entries/rules.xml b/entries/rules.xml deleted file mode 100644 index 5c510bc..0000000 --- a/entries/rules.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - .rules() - Read, add and remove rules for an element. - - Returns the validations rules for the first selected element or - -

Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $( "form" ).validate() is called first or

- -

Removes the specified rules and returns all rules for the first matched element.

- -

There are several ways to specify validation rules.

- -

When setting, the rules can also contain a messages-object, specifying custom messages for existing or added rules.

-
- - Read rules for the first element - - - Add rules - - - The rules to add. Accepts the same format as the rules-option of the validate-method. - - - - Remove rules - - - The space-seperated names of rules to remove and return. If left unspecified, removes and returns all rules. Manipulates only rules specified via rules-option or via rules("add"). - - - - Adds minlength: 2 to an element which is already required. - - - - Adds required and minlength: 2 to an element and specifies custom messages for both. - - - - Removes all static rules from an element. - - - - Removes min and max rules from an element. - - - -
diff --git a/entries/step-method.xml b/entries/step-method.xml deleted file mode 100644 index 5202f29..0000000 --- a/entries/step-method.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - step method - Makes the element require a given step. - - Works with text inputs. No support for input types: date, datetime, datetime-local, month, time and week. - - - - - Step value required - - - - - Makes "field" required and step of 10. - -Required, step 10: - -
- -]]> -
- -
diff --git a/entries/url-method.xml b/entries/url-method.xml deleted file mode 100644 index 3bf8df7..0000000 --- a/entries/url-method.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - url method - Makes the element require a valid url - - Return true, if the value is a valid url. -

Works with text inputs.

-
- - Makes "field" required and a url. - -Required, URL: - -
- -]]> -
- -
diff --git a/entries/valid.xml b/entries/valid.xml deleted file mode 100644 index feb79ea..0000000 --- a/entries/valid.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - .valid() - Checks whether the selected form is valid or whether all selected elements are valid. - - validate() needs to be called on the form before checking it using this method. - - - - - Sets up validation for a form, then checks if the form is valid when clicking a button. - - - - -
- - -]]> -
- -
diff --git a/entries/validate.xml b/entries/validate.xml deleted file mode 100644 index 640ed6c..0000000 --- a/entries/validate.xml +++ /dev/null @@ -1,544 +0,0 @@ - - - .validate() - Validates the selected form. - - This method sets up event handlers for submit, focus, keyup, blur and click to trigger validation of the entire form or individual elements. Each one can be disabled, see the onxxx options (onsubmit, onfocusout, onkeyup, onclick). focusInvalid focuses elements when submitting an invalid form. -

Use the debug option to ease setting up validation rules, it always prevents the default submit, even when script errors occur.

-

Use submitHandler to implement your own form submit, eg. via Ajax. Use invalidHandler to react when an invalid form is submitted.

-

Use rules and messages to specify which elements to validate, and how. See rules() for more details about specifying validation rules.

-

Use errorClass, errorElement, wrapper, errorLabelContainer, errorContainer, showErrors, success, errorPlacement, highlight, unhighlight, and ignoreTitle to control how invalid elements and error messages are displayed.

-
- - - - - Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console (will check if a window.console property exists). Try to enable when a form is just submitted instead of validation stopping the submit. -

Example: Prevents the form from submitting and tries to help setting up the validation with warnings about missing methods and other debug messages.

-

-					$("#myform").validate({
-						debug: true
-					});
-					
-
- -
- - - Callback for handling the actual submit when the form is valid. Gets the form and the submit event as the only arguments. Replaces the default submit. The right place to submit a form via Ajax after it is validated. -

Example: Submits the form via Ajax, using jQuery Form plugin, when valid.

-

-					$("#myform").validate({
-						submitHandler: function(form) {
-							$(form).ajaxSubmit();
-						}
-					});
-					
-

Example: Use submitHandler to process something and then using the default submit. Note that "form" refers to a DOM element, this way the validation isn't triggered again.

-

-					$("#myform").validate({
-						submitHandler: function(form) {
-							// do other things for a valid form
-							form.submit();
-						}
-					});
-					
-

The callback gets passed two arguments:

-
- - The form currently being validated, as a DOMElement. - - - The submit event instance. - - -
- - - Callback for custom code when an invalid form is submitted. Called with an event object as the first argument, and the validator as the second. -

Example: Displays a message above the form, indicating how many fields are invalid when the user tries to submit an invalid form.

-

-					$("#myform").validate({
-						invalidHandler: function(event, validator) {
-							// 'this' refers to the form
-							var errors = validator.numberOfInvalids();
-							if (errors) {
-								var message = errors == 1
-									? 'You missed 1 field. It has been highlighted'
-									: 'You missed ' + errors + ' fields. They have been highlighted';
-								$("div.error span").html(message);
-								$("div.error").show();
-							} else {
-								$("div.error").hide();
-							}
-						}
-					});
-					
-

The callback gets passed two arguments:

-
- - A custom event object, since this function is bound as an event handler. - - - The validator instance for the current form. - - -
- - - Elements to ignore when validating, simply filtering them out. jQuery's not-method is used, therefore everything that is accepted by not() can be passed as this option. Inputs of type submit and reset are always ignored, so are disabled elements. -

Example: Ignores all elements with the class "ignore" when validating.

-

-					$("#myform").validate({
-						ignore: ".ignore"
-					});
-					
-
- -
- - - Key/value pairs defining custom rules. Key is the name of an element (or a group of checkboxes/radio buttons), value is an object consisting of rule/parameter pairs or a plain String. Can be combined with class/attribute/data rules. Each rule can be specified as having a depends-property to apply the rule only in certain conditions. See the second example below for details. -

Example: Specifies a name element as required and an email element as required (using the shortcut for a single rule) and a valid email address (using another object literal).

-

-					$("#myform").validate({
-						rules: {
-							// simple rule, converted to {required:true}
-							name: "required",
-							// compound rule
-							email: {
-								required: true,
-								email: true
-							}
-						}
-					});
-					
-

Example: Specifies a contact element as required and as email address, the latter depending on a checkbox being checked for contact via email.

-

-					$("#myform").validate({
-						rules: {
-							contact: {
-								required: true,
-								email: {
-									depends: function(element) {
-										return $("#contactform_email").is(":checked");
-									}
-								}
-							}
-						}
-					});
-					
-

Example: Configure a rule that requires a parameter, along with a depends callback.

-

-					$("#myform").validate({
-						rules: {
-							// at least 15€ when bonus material is included
-							pay_what_you_want: {
-								required: true
-								min: {
-									// min needs a parameter passed to it
-									param: 15,
-									depends: function(element) {
-										return $("#bonus-material").is(":checked");
-									}
-								}
-							}
-						}
-					});
-					
-
- -
- - - Key/value pairs defining custom messages. Key is the name of an element, value the message to display for that element. Instead of a plain message, another map with specific messages for each rule can be used. Overrides the title attribute of an element or the default message for the method (in that order). Each message can be a String or a Callback. The callback is called in the scope of the validator, with the rule's parameters as the first argument and the element as the second, and must return a String to display as the message. -

Example: Specifies a name element as required and an email element as required and a valid email address. A single message is specified for the name element, and two messages for email.

-

-					$("#myform").validate({
-						rules: {
-							name: "required",
-							email: {
-								required: true,
-								email: true
-							}
-						},
-						messages: {
-							name: "Please specify your name",
-							email: {
-								required: "We need your email address to contact you",
-								email: "Your email address must be in the format of name@domain.com"
-							}
-						}
-					});
-					
-

Example: Validates the name-field as required and having at least two characters. Provides a callback message using jQuery.validator.format to avoid having to specify the parameter in two places.

-

-					$("#myform").validate({
-						rules: {
-							name: {
-								required: true,
-								minlength: 2
-							}
-						},
-						messages: {
-							name: {
-								required: "We need your email address to contact you",
-								minlength: jQuery.validator.format("At least {0} characters required!")
-							}
-						}
-					});
-					
-
- -
- - - Specify grouping of error messages. A group consists of an arbitrary group name as the key and a space separated list of element names as the value. Use errorPlacement to control where the group message is placed. -

Example: Use a table layout for the form, placing error messags in the next cell after the input.

-

-					$("#myform").validate({
-						groups: {
-							username: "fname lname"
-						},
-						errorPlacement: function(error, element) {
-							if (element.attr("name") == "fname" || element.attr("name") == "lname" ) {
-								error.insertAfter("#lastname");
-							} else {
-								error.insertAfter(element);
-							}
-						}
-					});
-					
-
- -
- - - Prepares/transforms the elements value for validation. - See normalizer docs for more details. - - - - - - Validate the form on submit. Set to false to use only other events for validation. -

Example: Disables onsubmit validation, allowing the user to submit whatever he wants, while still validating on keyup/blur/click events (if not specified otherwise).

-

-					$("#myform").validate({
-						onsubmit: false
-					});
-					
-
- -
- - - Validate elements (except checkboxes/radio buttons) on blur. If nothing is entered, all rules are skipped, except when the field was already marked as invalid. -

Set to a Function to decide for yourself when to run validation.

-

A boolean true is not a valid value.

-

Example: Disables focusout validation.

-

-					$("#myform").validate({
-						onfocusout: false
-					});
-					
-

The callback gets passed two arguments:

-
- - The element currently being validated, as a DOMElement. - - - The event object for this focusout event. - - - -
- - - Validate elements on keyup. As long as the field is not marked as invalid, nothing happens. Otherwise, all rules are checked on each key up event. Set to false to disable. -

Set to a Function to decide for yourself when to run validation.

-

A boolean true is not a valid value.

-

Example: Disables onkeyup validation.

-

-					$("#myform").validate({
-						onkeyup: false
-					});
-					
-

The callback gets passed two arguments:

-
- - The element currently being validated, as a DOMElement. - - - The event object for this keyup event. - - - -
- - - Validate checkboxes, radio buttons, and select elements on click. Set to false to disable. -

Set to a Function to decide for yourself when to run validation.

-

A boolean true is not a valid value.

-

Example: Disables onclick validation of checkboxes, radio buttons, and select elements.

-

-					$("#myform").validate({
-						onclick: false
-					});
-					
-

The callback gets passed two arguments:

-
- - The element currently being validated, as a DOMElement. - - - The event object for this click event. - - - -
- - - Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one that had focus when the form was submitted, avoiding stealing its focus. If there was no element focused, the first one in the form gets it, unless this option is turned off. -

Example: Disables focusing of invalid elements.

-

-					$("#myform").validate({
-						focusInvalid: false
-					});
-					
-
- -
- - - If enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused. Avoid combination with focusInvalid. -

Example: Enables cleanup when focusing elements, removing the error class and hiding error messages when an element is focused.

-

-					$("#myform").validate({
-						focusCleanup: true
-					});
-					
-
- -
- - - Use this class to create error labels, to look for existing error labels and to add it to invalid elements. -

Example: Sets the error class to "invalid".

-

-					$("#myform").validate({
-						errorClass: "invalid"
-					});
-					
-
- -
- - - This class is added to an element after it was validated and considered valid. -

Example: Sets the valid class to "success".

-

-					$("#myform").validate({
-						validClass: "success"
-					});
-					
-
- -
- - - Use this element type to create error messages and to look for existing error messages. The default, "label", has the advantage of creating a meaningful link between error message and invalid field using the for attribute (which is always used, regardless of element type). -

Example: Sets the error element to "em".

-

-					$("#myform").validate({
-						errorElement: "em"
-					});
-					
-
- -
- - - Wrap error labels with the specified element. Useful in combination with errorLabelContainer to create a list of error messages. -

Example: Wrap each error element with a list item, useful when using an ordered or unordered list as the error container.

-

-					$("#myform").validate({
-						wrapper: "li"
-					});
-					
-
- -
- - - Hide and show this container when validating. -

Example: All error labels are displayed inside an unordered list with the ID "messageBox", as specified by the selector passed as errorContainer option. All error elements are wrapped inside a li element, to create a list of messages.

-

-					$("#myform").validate({
-						errorLabelContainer: "#messageBox",
-						wrapper: "li",
-						submitHandler: function() { alert("Submitted!") }
-					});
-					
-
- -
- - - Hide and show this container when validating. -

Example: Uses an additonal container for error messages. The elements given as the errorContainer are all shown and hidden when errors occur. However, the error labels themselves are added to the element(s) given as errorLabelContainer, here an unordered list. Therefore the error labels are also wrapped into li elements (wrapper option).

-

-					$("#myform").validate({
-						errorContainer: "#messageBox1, #messageBox2",
-						errorLabelContainer: "#messageBox1 ul",
-						wrapper: "li", debug:true,
-						submitHandler: function() { alert("Submitted!") }
-					});
-					
-
- -
- - - A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second, called in the context of the validator object. The arguments contain only those elements currently validated, which can be a single element when doing validation on focusout or keyup. You can trigger (in addition to your own messages) the default behaviour by calling this.defaultShowErrors(). -

Example: Update the number of invalid elements each time an error is displayed. Delegates to the default implementation for the actual error display.

-

-					$("#myform").validate({
-						showErrors: function(errorMap, errorList) {
-							$("#summary").html("Your form contains "
-								+ this.numberOfInvalids()
-								+ " errors, see details below.");
-							this.defaultShowErrors();
-						}
-					});
-					
-

The callback gets passed two arguments:

-
- - Key/value pairs, where the key refers to the name of an input field, values the message to be displayed for that input. - - - An array for all currently validated elements. Contains objects with the following two properties: - - The message to be displayed for an input. - - - The DOMElement for this entry. - - - -
- - - Customize placement of created error labels. First argument: The created error label as a jQuery object. Second argument: The invalid element as a jQuery object. -

Example: Use a table layout for the form, placing error messages in the next cell after the input.

-

-					$("#myform").validate({
-						errorPlacement: function(error, element) {
-							error.appendTo( element.parent("td").next("td") );
-						}
-					});
-					
-

The callback gets passed two arguments:

-
- - The error label to insert into the DOM. - - - The validated input, for relative positioning. - - -
- - - If specified, the error label is displayed to show a valid element. If a String is given, it is added as a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element). The label can be used to add a text like "ok!". -

Example: Add a class "valid" to valid elements, styled via CSS.

-

-					$("#myform").validate({
-						success: "valid",
-						submitHandler: function() { alert("Submitted!") }
-					});
-					
-

Example: Add a class "valid" to valid elements, styled via CSS, and add the text "Ok!".

-

-					$("#myform").validate({
-						success: function(label) {
-							label.addClass("valid").text("Ok!")
-						},
-						submitHandler: function() { alert("Submitted!") }
-					});
-					
-

The callback gets passed two arguments:

-
- - The error label. Use to add a class or replace the text content. - - - The element currently being validated, as a DOMElement. - - - -
- - - How to highlight invalid fields. Override to decide which fields and how to highlight. -

Example: Highlights an invalid element by fading it out and in again.

-

-					$("#myform").validate({
-						highlight: function(element, errorClass) {
-							$(element).fadeOut(function() {
-								$(element).fadeIn();
-							});
-						}
-					});
-					
-

Example: Adds the error class to both the invalid element and its label

-

-					$("#myform").validate({
-						highlight: function(element, errorClass, validClass) {
-							$(element).addClass(errorClass).removeClass(validClass);
-							$(element.form).find("label[for=" + element.id + "]")
-								.addClass(errorClass);
-						},
-						unhighlight: function(element, errorClass, validClass) {
-							$(element).removeClass(errorClass).addClass(validClass);
-							$(element.form).find("label[for=" + element.id + "]")
-								.removeClass(errorClass);
-						}
-					});
-					
-

The callback gets passed three arguments:

-
- - - The invalid DOM element, usually an input. - - - Current value of the errorClass option. - - - Current value of the validClass option. - -
- - - Called to revert changes made by option highlight, same arguments as highlight. - - - - - - Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability, the message-from-title is likely to be completely removed in a future release. -

Example: Configure the plugin to ignore title attributes on validated elements when looking for messages.

-

-					$("#myform").validate({
-						ignoreTitle: true
-					});
-					
-
- -
-
-
- -
diff --git a/entries2html.xsl b/entries2html.xsl deleted file mode 100644 index bcd622d..0000000 --- a/entries2html.xsl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -<!doctype html> -<html> -<head> -<meta charset="utf-8"> -<title></title> -<link rel="stylesheet" href="https://jqueryvalidation.org/files/demo/site-demos.css"> -<style> </style> -</head> -<body> -<form id="myform"></form> -<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> -<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script> -<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script> -<script> -// just for the demos, avoids form submit -jQuery.validator.setDefaults({ - debug: true, - success: "valid" -});</script> -</body> -</html> - - - diff --git a/index.md b/index.md new file mode 100644 index 0000000..d5576c3 --- /dev/null +++ b/index.md @@ -0,0 +1,50 @@ +--- +layout: default +title: jQuery Validation Plugin +--- + +This jQuery plugin makes simple clientside form validation easy, whilst still offering plenty of customization options. It makes a good choice if you're building something new from scratch, but also when you're trying to integrate something into an existing application with lots of existing markup. The plugin comes bundled with a useful set of validation methods, including URL and email validation, while providing an API to write your own methods. All bundled methods come with default error messages in English and translations into 37 other languages. + +For a quick overview of what this plugin provides, check out this [Webucator](https://www.webucator.com/) video (they also provide [jQuery trainings](https://www.webucator.com/webdesign/jquery.cfm)): + + + +The plugin was initially written and maintained by [Jörn Zaefferer](http://bassistance.de/), a member of the [jQuery team](https://jquery.org/team), lead developer on the jQuery UI team and maintainer of QUnit. It was started back in the early days of jQuery in 2006, and updated and improved since then. + +Starting with Version 1.15.0 [Markus Staab](https://github.com/staabm) took over the maintenance of the codebase in February 2016. Since July 2016 [Brahim Arkni](https://github.com/Arkni) assisted Markus, and a few months later Brahim joined the jQuery Validation core team. + +**Current version:** 1.19.5 + +**License:** MIT + +### Files: +- [Download](https://github.com/jzaefferer/jquery-validation/releases/tag/1.19.5) - zip-Archive with source code, minified and packed version, demos and examples +- [Changelog](https://github.com/jzaefferer/jquery-validation/releases/tag/1.19.5) +- [Demos](https://jqueryvalidation.org/files/demo/) +- [Documentation](documentation/) +- [GitHub Repository](https://github.com/jzaefferer/jquery-validation) + +### Installation via Package Managers +- Bower: `bower install jquery-validation` +- [NuGet](https://www.nuget.org/packages/jquery.validation): `Install-Package jQuery.Validation` +- [NPM](https://www.npmjs.com/package/jquery-validation): `npm i jquery-validation` + +### [Latest files on jsDelivr CDN](https://www.jsdelivr.com/package/npm/jquery-validation) (hotlinking welcome): +- [https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.js](https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.js) +- [https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.min.js](https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.min.js) +- [https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/additional-methods.js](https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/additional-methods.js) +- [https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/additional-methods.min.js](https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/additional-methods.min.js) + +### [Latest files on cdnjs CDN](https://cdnjs.com/libraries/jquery-validate) (hotlinking welcome): +- [https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.js](https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.js) +- [https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js](https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js) +- [https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.js](https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.js) +- [https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.min.js](https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/additional-methods.min.js) + +### Dependencies +#### Required +- [jQuery, tested with 1.7.2, 1.8.3, 1.9.1, 1.11.1, 3.1.1](https://jquery.com) + +### Support +- Please post questions to the [official using jQuery Plugins Forum](https://forum.jquery.com/using-jquery-plugins), tagging your question with (at least) "validate". Keep your question short and succinct and provide code when possible; a testpage makes it much more likely that you get an useful answer in a shorter time. +- Please post bug reports and other contributions (enhancements, features, eg. new validation methods) to the [GitHub issue tracker](https://github.com/jzaefferer/jquery-validation/issues) diff --git a/notes.xsl b/notes.xsl deleted file mode 100644 index 83ddcee..0000000 --- a/notes.xsl +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index cfbfc18..0000000 --- a/package-lock.json +++ /dev/null @@ -1,412 +0,0 @@ -{ - "name": "jqueryvalidation-content", - "version": "1.0.0", - "lockfileVersion": 1, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "argparse": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", - "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", - "dependencies": { - "underscore.string": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", - "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=" - } - } - }, - "async": { - "version": "0.1.22", - "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", - "integrity": "sha1-D8GqoIig4+8Ovi2IMbqw3PiEUGE=" - }, - "cheerio": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.17.0.tgz", - "integrity": "sha1-+lrkLMYBIRM9KW0LRtmDIV9yaOo=", - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - } - } - }, - "coffee-script": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", - "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=" - }, - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "CSSselect": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/CSSselect/-/CSSselect-0.4.1.tgz", - "integrity": "sha1-+Kt+H4QYzmPNput713ioXX7EkrI=" - }, - "CSSwhat": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/CSSwhat/-/CSSwhat-0.4.7.tgz", - "integrity": "sha1-hn2g/zn3eGEyQsRM/qg/CqTr35s=" - }, - "dateformat": { - "version": "1.0.2-1.2.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", - "integrity": "sha1-sCIMAt6YYXQztyhRz0fePfLNvuk=" - }, - "dom-serializer": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.0.1.tgz", - "integrity": "sha1-lYmCfx4y0iw3yCmtq9WbMkevjq8=", - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" - } - } - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" - }, - "domhandler": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.1.tgz", - "integrity": "sha1-Wd+dzSJ+gIs2Wuc+H2aErD2Ub8I=" - }, - "domutils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", - "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=" - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" - }, - "esprima": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=" - }, - "eventemitter2": { - "version": "0.4.14", - "resolved": "http://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", - "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=" - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" - }, - "findup-sync": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", - "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", - "dependencies": { - "glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=" - }, - "lodash": { - "version": "2.4.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "minimatch": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", - "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=" - } - } - }, - "getobject": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", - "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=" - }, - "gilded-wordpress": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.0.tgz", - "integrity": "sha1-xqLn1wetWX2pMQdeAcL+iBtttaA=", - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" - }, - "glob": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", - "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=" - }, - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=" - }, - "minimatch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=" - } - } - }, - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "dependencies": { - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" - } - } - }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" - }, - "grunt": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", - "integrity": "sha1-VpN81RlDJK3/bSB2MYMqnWuk5/A=" - }, - "grunt-check-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.0.0.tgz", - "integrity": "sha1-Y/9erkYTF5tKifaozTcfekAfd4I=" - }, - "grunt-jquery-content": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-2.0.0.tgz", - "integrity": "sha1-jVFDOs0z/n7VL9956gAxwCRSwII=", - "dependencies": { - "async": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", - "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=" - }, - "which": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk=" - } - } - }, - "grunt-legacy-log": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", - "integrity": "sha1-7ClCboAwIa9ZAp+H0vnNczWgVTE=", - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "underscore.string": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" - } - } - }, - "grunt-legacy-log-utils": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", - "integrity": "sha1-wHBrndkGThFvNvI/5OawSGcsD34=", - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "underscore.string": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" - } - } - }, - "grunt-legacy-util": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", - "integrity": "sha1-kzJIhNv343qf98Am3/RR2UqeVUs=" - }, - "grunt-wordpress": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/grunt-wordpress/-/grunt-wordpress-2.1.0.tgz", - "integrity": "sha1-ty0EttVbQdFP/Yrq8W0ibFk9vl0=" - }, - "he": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", - "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=" - }, - "highlight.js": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.3.0.tgz", - "integrity": "sha1-bF8PZOcHj2ZAK82/yJEQw/0bqZ8=" - }, - "hooker": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", - "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" - }, - "htmlparser2": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz", - "integrity": "sha1-amTHdjfAjG8w7CqBV6UzM758sF4=", - "dependencies": { - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=" - }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" - } - } - }, - "iconv-lite": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", - "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg=" - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "js-yaml": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", - "integrity": "sha1-olrmUJmZ6X3yeMZxnaEb0Gh3Q6g=" - }, - "lodash": { - "version": "0.9.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", - "integrity": "sha1-jzSZxSRdNG1oLlsNO0B2fgnxqSw=" - }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" - }, - "marked": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", - "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=" - }, - "natives": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.4.tgz", - "integrity": "sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg==" - }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=" - }, - "rimraf": { - "version": "2.2.8", - "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" - }, - "sax": { - "version": "0.4.3", - "resolved": "http://registry.npmjs.org/sax/-/sax-0.4.3.tgz", - "integrity": "sha1-cA46NOsueSzjgHkccSgPNzGWXdw=" - }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" - }, - "spawnback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", - "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "underscore": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", - "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" - }, - "underscore.string": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", - "integrity": "sha1-18D6KvXVoaZ/QlPa7pgTLnM/Dxk=" - }, - "which": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", - "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=" - }, - "wordpress": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.0.0.tgz", - "integrity": "sha1-m+FQ5pObYUnVw0F017UIeOK7s88=" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xmlbuilder": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.3.1.tgz", - "integrity": "sha1-XtTCK0YiwkN/r4Pk8jbyPWu/JkE=" - }, - "xmlrpc": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.0.1.tgz", - "integrity": "sha1-QZcSWnn5mG1Ih2cVqC0Gj+8WiuM=" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 77f8011..0000000 --- a/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "jqueryvalidation-content", - "title": "jQuery Validation Plugin site content", - "description": "Site content for the jQuery Validation Plugin", - "version": "1.0.0", - "homepage": "https://jqueryvalidation.org/", - "author": { - "name": "Jörn Zaefferer (http://bassistance.de/)" - }, - "repository": { - "type": "git", - "url": "git://github.com/jquery-validation/validation-content.git" - }, - "bugs": { - "url": "https://github.com/jquery-validation/validation-content/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://opensource.org/licenses/MIT" - } - ], - "dependencies": { - "grunt": "0.4.5", - "grunt-jquery-content": "2.0.0" - } -} diff --git a/pages/index.html b/pages/index.html deleted file mode 100644 index d6df4f7..0000000 --- a/pages/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - -

This jQuery plugin makes simple clientside form validation easy, whilst still offering plenty of customization options. It makes a good choice if you’re building something new from scratch, but also when you’re trying to integrate something into an existing application with lots of existing markup. The plugin comes bundled with a useful set of validation methods, including URL and email validation, while providing an API to write your own methods. All bundled methods come with default error messages in english and translations into 37 other languages.

- -

For a quick overview of what this plugin provides, check out this Webucator video (they also provide jQuery trainings):

- - -

The plugin was initially written and maintained by Jörn Zaefferer, a member of the jQuery team, lead developer on the jQuery UI team and maintainer of QUnit. It was started back in the early days of jQuery in 2006, and updated and improved since then.

-

Starting with Version 1.15.0 Markus Staab took over the maintenance of the codebase in February 2016. Since July 2016 Brahim Arkni assisted Markus, and a few months later Brahim joined the jQuery Validation core team.

- -
Current version: 1.19.5
-
License: MIT
- -

Files:

-Download -Changelog -Demos -Documentation -GitHub Repository - -

Installation via Package Managers

- - -

-Latest files on jsDelivr CDN (hotlinking welcome):

- - -

-Latest files on cdnjs CDN (hotlinking welcome):

- - - -

Dependencies

-

Required

- - -

Support

- diff --git a/pages/reference.md b/reference.md similarity index 99% rename from pages/reference.md rename to reference.md index 535c9b6..7d1f82c 100644 --- a/pages/reference.md +++ b/reference.md @@ -1,6 +1,7 @@ - +--- +layout: default +title: Reference documentation +--- # Goals The ultimate goal of this plugin is to make working with forms more fun for everyone. By improving the interaction, it is easier and less annoying for the user to fill out the form and submit it.