thub.com
From c2927814d76b85af6ed7eed69cb358491859bba3 Mon Sep 17 00:00:00 2001
From: Stanislav Ievlev
Date: Tue, 12 Feb 2013 17:24:14 +0400
Subject: [PATCH 1/2] Search for an item to compare in context of form
---
jquery.validate.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jquery.validate.js b/jquery.validate.js
index 3c02627ab..bdf938366 100644
--- a/jquery.validate.js
+++ b/jquery.validate.js
@@ -1152,7 +1152,7 @@ $.extend($.validator, {
equalTo: function( value, element, param ) {
// bind to the blur event of the target in order to revalidate whenever the target field is updated
// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
- var target = $(param);
+ var target = $(param, element.form);
if ( this.settings.onfocusout ) {
target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
$(element).valid();
From e72815b757ea93aa763187427b63f310edec70f4 Mon Sep 17 00:00:00 2001
From: Stanislav Ievlev
Date: Wed, 13 Feb 2013 12:13:32 +0400
Subject: [PATCH 2/2] Add unit tests for equalTo method with a "by-name"
selector
---
test/index.html | 6 ++++++
test/methods.js | 3 ++-
test/test.js | 10 ++++++++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/test/index.html b/test/index.html
index bb9fc4ad8..0c4aae0f6 100644
--- a/test/index.html
+++ b/test/index.html
@@ -108,6 +108,11 @@
+
+