The plugin is 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.
The plugin is 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.
-
Current version: 1.13.0
+
Current version: 1.13.1
License: MIT
Files:
-Download
-Changelog
+Download
+ChangelogDemosDocumentationGitHub Repository
From 2e7ef1887d9fab896db3583705868715d659cda2 Mon Sep 17 00:00:00 2001
From: Ryley Breiddal
Date: Thu, 5 Jun 2014 11:01:38 -0700
Subject: [PATCH 05/91] Add an example of a rule with a param and a depends
Fixes jzaefferer/jquery-validation#451
Closes #7
---
entries/validate.xml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/entries/validate.xml b/entries/validate.xml
index 95278ec..0ec3090 100644
--- a/entries/validate.xml
+++ b/entries/validate.xml
@@ -125,6 +125,24 @@
}
});
+
Example: Configure a rule that requires a parameter, along with a depends callback.
+
+ $(".selector").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');
+ }
+ }
+ }
+ }
+ });
+
From cdcb13685f3a17ce04b7323552fcaaab5cac9dd4 Mon Sep 17 00:00:00 2001
From: neokabuto
Date: Tue, 22 Jul 2014 16:29:44 -0400
Subject: [PATCH 07/91] Update documentation.md
Fix links to demos
---
pages/documentation.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pages/documentation.md b/pages/documentation.md
index 1645411..bd89203 100644
--- a/pages/documentation.md
+++ b/pages/documentation.md
@@ -11,7 +11,7 @@ You may need different ways to specify validation rules according to the server-
**"But aren't there already a ton of validation plugins out there?"**
Right, there are a lot of non-jQuery-based solutions (which you'd avoid since you found jQuery) and some jQuery-based solutions. This particular one is one of the oldest jQuery plugins (started in July 2006) and has proved itself in projects all around the world. There is also an [article](http://bassistance.de/2007/07/04/about-client-side-form-validation-and-frameworks/) discussing how this plugin fits the bill of the should-be validation solution.
-Not convinced? [Have a look at this example](http://jquery.bassistance.de/validate/demo/):
+Not convinced? [Have a look at this example](http://jqueryvalidation.org/files/demo/):
-[Demo for the cancel button](http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html)
+[Demo for the cancel button](http://jqueryvalidation.org/files/demo/errorcontainer-demo.html)
# Validation event
By default, forms are validated on submit, triggered by the user clicking the submit button or pressing enter when a form input is focused (option onsubmit). In addition, once a field was highlighted as being invalid, it is validated whenever the user types something in the field (option onkeyup). When the user enters something invalid into a valid field, it is also validated when the field loses focus (option onblur).
From 93523b608f7d65a71042425aad1a9be8846c2324 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?=
Date: Tue, 2 Dec 2014 17:47:55 +0100
Subject: [PATCH 09/91] Validate: Fix depends callback example
Fixes jzaefferer/jquery-validation#1333
---
entries/validate.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/entries/validate.xml b/entries/validate.xml
index 0ec3090..20ccc8d 100644
--- a/entries/validate.xml
+++ b/entries/validate.xml
@@ -118,7 +118,7 @@
required: true,
email: {
depends: function(element) {
- return $("#contactform_email:checked")
+ return $("#contactform_email").is(":checked");
}
}
}
@@ -136,7 +136,7 @@
// min needs a parameter passed to it
param: 15,
depends: function(element) {
- return $("#bonus-material").is(':checked');
+ return $("#bonus-material").is(":checked");
}
}
}
From 338025a140cb9420df11d4d1bb9dc9e8cd8ff24d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?=
Date: Tue, 9 Dec 2014 15:48:39 +0100
Subject: [PATCH 10/91] Reference: Add brief example for reusing existing
methods in other methods
---
pages/reference.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pages/reference.md b/pages/reference.md
index a9a585a..5dba057 100644
--- a/pages/reference.md
+++ b/pages/reference.md
@@ -65,6 +65,12 @@ With that in place, we can add a class customer to all customer fields and be do
+You can also reuse existing methods inside other custom methods, to reuse certain implementations. For example, if you're writing a custom method for validating email addresses inside a single field, you could call the existing email method for each email:
+
+```js
+jQuery.validator.methods.email.call(this, email, element)
+```
+
# Error messages
An error message displays a hint for the user about invalid elements, and what is wrong. There are three ways to provide error messages. Via the title attribute of the input element to validate, via error labels and via plugin settings (option messages).
From 1610c42500ae6caea019c72874b165b4ac8ceef9 Mon Sep 17 00:00:00 2001
From: Dmitriy Akulov
Date: Thu, 10 Jul 2014 20:43:09 +0300
Subject: [PATCH 11/91] Index: Add jsDelivr links
Closes #8
---
pages/index.html | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/pages/index.html b/pages/index.html
index c8d03f8..0b1d1d2 100644
--- a/pages/index.html
+++ b/pages/index.html
@@ -4,7 +4,7 @@
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.
-
\ No newline at end of file
+
From 5243c70910039a71b4bc8e9e8efc931578d29028 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?=
Date: Fri, 19 Dec 2014 12:55:48 +0100
Subject: [PATCH 12/91] Documentation: Drop reference to dead site
---
pages/documentation.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pages/documentation.md b/pages/documentation.md
index bd89203..b6c1b5e 100644
--- a/pages/documentation.md
+++ b/pages/documentation.md
@@ -199,7 +199,7 @@ Contributed by Michael Evangelista, showing a multipart form for buying and sell
* Integration with masked-input plugin, see Phone and Zip fields
## [Using remote validation to help with captchas](http://jqueryvalidation.org/files/demo/captcha/)
-Features remote validation for helping the user to fill out captchas, based on example at [psyrens.com](http://psyrens.com/captcha/).
+Features remote validation for helping the user to fill out captchas.
*Notable features of the demo:*
From 4d6b7f97f4445783928a152a513233f18062e1ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?=
Date: Fri, 19 Dec 2014 12:56:03 +0100
Subject: [PATCH 13/91] Index: Add Webucator video, ask for donations more
directly
---
pages/index.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pages/index.html b/pages/index.html
index 0b1d1d2..a7b1c6e 100644
--- a/pages/index.html
+++ b/pages/index.html
@@ -4,7 +4,10 @@
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.
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:
+
For a quick overview of what this plugin provides, check out this Webucator video (they also provide jQuery trainings):