From d34679d3629e4ea3e192676957e96f33296c3791 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Perras Date: Wed, 4 Feb 2015 18:08:11 -0500 Subject: [PATCH 1/2] Allowed JQuery object to the element Validator. --- jquery.validation/jquery.validation.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index f8b6ca70c5..118b19ef6b 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -186,7 +186,7 @@ interface Validator * * @param element An element to validate, must be inside the validated form. eg "#myselect" */ - element(element: string): boolean; + element(element: string|JQuery): boolean; /** * Validates the form, returns true if it is valid, false otherwise. */ From e8a6d12dc7d0321d5a2b44b655d3f3aa7c7b2391 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Perras Date: Wed, 4 Feb 2015 18:09:38 -0500 Subject: [PATCH 2/2] Updated the tests test JQuery param. Added a new test to validate that the element union now accepts JQuery object. --- jquery.validation/jquery.validation-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index fcc22d2961..5a6a107706 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -187,6 +187,7 @@ function test_methods() { }); $("#myform").validate().form(); $("#myform").validate().element("#myselect"); + $("#myform").validate().element($("#myselect")); var validator = $("#myform").validate(); validator.resetForm(); validator.showErrors({ "firstname": "I know that your firstname is Pete, Pete!" });